enforce auth
This commit is contained in:
parent
d63a452f75
commit
01f4b3743c
1 changed files with 3 additions and 2 deletions
|
|
@ -1,8 +1,9 @@
|
|||
const sessionService = require('../services/sessionService');
|
||||
|
||||
async function rejectIfNotAuthorizedMiddleware(req, res, next) {
|
||||
console.log("I'm checking stuff, aight?");
|
||||
console.log(`Is session authorized: ${await sessionService.isSessionAuthorized(req.cookies.sessionUuid)}`)
|
||||
if (!await sessionService.isSessionAuthorized(req.cookies.sessionUuid)) {
|
||||
res.redirect('/');
|
||||
}
|
||||
next();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue