redirect nicely depending on authorized or not
This commit is contained in:
parent
2e79a1fadd
commit
70f9118d82
4 changed files with 23 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ const sessionService = require('../services/sessionService');
|
|||
|
||||
async function redirectIfNotAuthorizedMiddleware(req, res, next) {
|
||||
if (!(await sessionService.isSessionAuthorized(req.cookies.sessionUuid))) {
|
||||
return res.redirect('/');
|
||||
return res.redirect('/login');
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue