webaccess: Move preAuthorize to its own middleware

This commit is contained in:
Richard Hansen 2021-12-18 16:30:17 -05:00
parent 7f3d0e71f7
commit bf35dcfc50
2 changed files with 71 additions and 47 deletions

View file

@ -204,6 +204,8 @@ exports.restartServer = async () => {
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(webaccess.checkAccess);
await Promise.all([