1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 23:19:29 +00:00

Made auth middleware more readable

This commit is contained in:
2022-02-24 13:52:38 +00:00
parent ced35b41ca
commit 67d15db4ee

2
app.js
View File

@@ -97,7 +97,7 @@ async function main() {
// Extract the first component of the path from the request
const path = `/${req.path.split('/')?.[1] ?? ''}`;
if (!(allowed.includes(path) || req.session.authenticated))
if (!allowed.includes(path) && !req.session.authenticated)
return res.redirect('/login');
next();