We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 405acb4 commit 48c4748Copy full SHA for 48c4748
1 file changed
src/authentication/protected-routes.handler.ts
@@ -25,11 +25,14 @@ export const withProtectedRoutesHandler = (
25
return next();
26
}
27
28
- if (isAdminRoute(req.originalUrl, rootPath) && !!req.session.adminUser) {
29
- return next();
+ if (isAdminRoute(req.originalUrl, rootPath)) {
+ if (!!req.session.adminUser) {
30
+ return next();
31
+ }
32
+ return res.redirect(loginPath);
33
34
- return res.redirect(loginPath);
35
+ return next(); // custom routes in admin router
36
});
37
};
38
0 commit comments