import { Middleware } from '../base/http';
import session from 'express-session';
import { Guid } from '../base/util';
import { MiddlewareOrder } from './MiddlewareOrder';
class SessionMiddleware extends Middleware {
	protected order = MiddlewareOrder.SessionMiddleware;
	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 { SessionMiddleware };