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');
|
const sessionService = require('../services/sessionService');
|
||||||
|
|
||||||
async function rejectIfNotAuthorizedMiddleware(req, res, next) {
|
async function rejectIfNotAuthorizedMiddleware(req, res, next) {
|
||||||
console.log("I'm checking stuff, aight?");
|
if (!await sessionService.isSessionAuthorized(req.cookies.sessionUuid)) {
|
||||||
console.log(`Is session authorized: ${await sessionService.isSessionAuthorized(req.cookies.sessionUuid)}`)
|
res.redirect('/');
|
||||||
|
}
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue