express: Move `preAuthorize` middleware before express-session

pull/5329/head
Richard Hansen 2021-12-18 16:54:23 -05:00
parent bf35dcfc50
commit 0b1ec20c5c
1 changed files with 2 additions and 2 deletions

View File

@ -201,11 +201,11 @@ exports.restartServer = async () => {
secure: 'auto',
},
});
app.use(exports.sessionMiddleware);
app.use(cookieParser(settings.sessionKey, {}));
// If webaccess.preAuthorize explicitly grants access, webaccess.checkAccess will skip all checks.
app.use(webaccess.preAuthorize);
app.use(exports.sessionMiddleware);
app.use(cookieParser(settings.sessionKey, {}));
app.use(webaccess.checkAccess);
await Promise.all([