summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;