we can now check if a session is authorized

This commit is contained in:
counterweight 2025-02-10 15:02:38 +01:00
parent 5e24fc29fb
commit d63a452f75
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
4 changed files with 51 additions and 8 deletions

View file

@ -0,0 +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)}`)
next();
}
module.exports = rejectIfNotAuthorizedMiddleware;