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'; |
'use strict'; |
||||||
|
|
||||||
module.exports = (req, res, next) => { |
module.exports = (req, res, next) => { |
||||||
if (req.session.authenticated === true) return next() |
if (req.session.authenticated === true) { |
||||||
res.redirect('/login') |
return next(); |
||||||
|
} |
||||||
|
const redirect = req.params.board; |
||||||
|
if (redirect) { |
||||||
|
res.redirect(`/login?redirect=${redirect}`); |
||||||
|
} else { |
||||||
|
res.redirect('/login'); |
||||||
|
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue