Added express-session
This commit is contained in:
@@ -2,6 +2,14 @@ import type { Application } from 'express'
|
||||
import logger from 'morgan'
|
||||
import express from 'express'
|
||||
import cookieParser from 'cookie-parser'
|
||||
import session from 'express-session'
|
||||
|
||||
declare module 'express-session' {
|
||||
export interface SessionData {
|
||||
dz: any;
|
||||
}
|
||||
}
|
||||
|
||||
import { WEBUI_DIR } from './helpers/paths'
|
||||
|
||||
export function registerMiddlewares(app: Application) {
|
||||
@@ -12,5 +20,10 @@ export function registerMiddlewares(app: Application) {
|
||||
app.use(express.json())
|
||||
app.use(express.urlencoded({ extended: false }))
|
||||
app.use(cookieParser())
|
||||
app.use(session({
|
||||
secret: "U2hoLCBpdHMgYSBzZWNyZXQh",
|
||||
resave: true,
|
||||
saveUninitialized: true
|
||||
}))
|
||||
app.use(express.static(WEBUI_DIR))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user