mirror of https://gitgud.io/fatchan/jschan.git
parent
db963d4607
commit
3c327862d9
4 changed files with 25 additions and 11 deletions
@ -1,6 +1,13 @@ |
||||
'use strict'; |
||||
|
||||
module.exports = (req, res, next) => { |
||||
if (req.session.authenticated === true) return next() |
||||
res.redirect('/login') |
||||
if (req.session.authenticated === true) { |
||||
return next(); |
||||
} |
||||
const redirect = req.params.board; |
||||
if (redirect) { |
||||
res.redirect(`/login?redirect=${redirect}`); |
||||
} else { |
||||
res.redirect('/login'); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue