import { Middleware } from '../base/http'; import session from 'express-session'; import { Guid } from '../base/util'; class SessionMiddleware extends Middleware { protected order = -98; protected route = null; protected action = session({ secret: this.context.options?.sessionSecret || Guid.new(), resave: this.context.options?.sessionResave || false, saveUninitialized: this.context.options?.sessionSaveUninitialized || false, cookie: { maxAge: this.context.options?.sessionMaxAge || 3600000 } }); } export default SessionMiddleware;