1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 20:39:28 +00:00

Added redirect_to to login page when auth forces re-authentication

This commit is contained in:
2022-04-12 00:34:32 +00:00
parent 26f0a6e2cc
commit 6406cd5a5c
3 changed files with 9 additions and 2 deletions

2
app.js
View File

@@ -106,7 +106,7 @@ async function main() {
const path = `/${req.path.split('/')?.[1] ?? ''}`;
if (!allowed.includes(path) && !req.session.authenticated)
return res.redirect('/login');
return res.redirect(`/login?redirect_to=${req.path}`);
next();
});