admin page fix

This commit is contained in:
Jan Prochazka
2024-07-30 15:31:51 +02:00
parent f345c80144
commit 2c805b3357
2 changed files with 6 additions and 1 deletions

View File

@@ -25,7 +25,9 @@ function authMiddleware(req, res, next) {
// console.log('********************* getAuthProvider()', getAuthProvider());
if (!getAuthProvider().shouldAuthorizeApi()) {
const isAdminPage = req.headers['x-is-admin-page'] == 'true';
if (!isAdminPage && !getAuthProvider().shouldAuthorizeApi()) {
return next();
}
let skipAuth = !!SKIP_AUTH_PATHS.find(x => req.path == getExpressPath(x));