summaryrefslogtreecommitdiff
path: root/middlewares
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-30 23:22:23 +0100
committerJulien Dessaux2022-10-30 23:22:23 +0100
commit41974aefd5dd94c054db0d5293ffdd56039fbfd9 (patch)
tree9154f65e27a12a1722ffe0e9ef15f7abe9293768 /middlewares
parentAdded register and login database functions, and use the last one in the logi... (diff)
downloadjeux-de-mots-41974aefd5dd94c054db0d5293ffdd56039fbfd9.tar.gz
jeux-de-mots-41974aefd5dd94c054db0d5293ffdd56039fbfd9.tar.bz2
jeux-de-mots-41974aefd5dd94c054db0d5293ffdd56039fbfd9.zip
Fixed middleware action without return
Diffstat (limited to '')
-rw-r--r--middlewares/requireAuth.js4
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;