diff options
author | Julien Dessaux | 2022-10-30 23:22:23 +0100 |
---|---|---|
committer | Julien Dessaux | 2022-10-30 23:22:23 +0100 |
commit | 41974aefd5dd94c054db0d5293ffdd56039fbfd9 (patch) | |
tree | 9154f65e27a12a1722ffe0e9ef15f7abe9293768 /middlewares | |
parent | Added register and login database functions, and use the last one in the logi... (diff) | |
download | jeux-de-mots-41974aefd5dd94c054db0d5293ffdd56039fbfd9.tar.gz jeux-de-mots-41974aefd5dd94c054db0d5293ffdd56039fbfd9.tar.bz2 jeux-de-mots-41974aefd5dd94c054db0d5293ffdd56039fbfd9.zip |
Fixed middleware action without return
Diffstat (limited to 'middlewares')
-rw-r--r-- | middlewares/requireAuth.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/middlewares/requireAuth.js b/middlewares/requireAuth.js index 7e74339..1ea6deb 100644 --- a/middlewares/requireAuth.js +++ b/middlewares/requireAuth.js @@ -1,8 +1,8 @@ function requireAuth(req, res, next) { if (req.session.user !== undefined) { - next(); + return next(); } - res.redirect(302, "/login"); + return res.redirect(302, "/login"); } export default requireAuth; |