express: Move up `cookie-parser` middleware
This makes it possible for the `preAuthorize` and `preExpressSession` hooks to easily read or set cookies.pull/5358/head
parent
ab85db4426
commit
75637708c0
|
@ -170,6 +170,8 @@ exports.restartServer = async () => {
|
|||
}));
|
||||
}
|
||||
|
||||
app.use(cookieParser(settings.sessionKey, {}));
|
||||
|
||||
exports.sessionMiddleware = expressSession({
|
||||
secret: settings.sessionKey,
|
||||
store: new SessionStore(),
|
||||
|
@ -212,7 +214,6 @@ exports.restartServer = async () => {
|
|||
// call `next('route')` which will skip the remaining middlewares in this list.
|
||||
webaccess.nextRouteIfPreAuthorized,
|
||||
exports.sessionMiddleware,
|
||||
cookieParser(settings.sessionKey, {}),
|
||||
webaccess.checkAccess,
|
||||
]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue