we can now check if a session is authorized
This commit is contained in:
parent
5e24fc29fb
commit
d63a452f75
4 changed files with 51 additions and 8 deletions
9
src/middlewares/authMiddleware.js
Normal file
9
src/middlewares/authMiddleware.js
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue