From 41974aefd5dd94c054db0d5293ffdd56039fbfd9 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 30 Oct 2022 23:22:23 +0100 Subject: Fixed middleware action without return --- middlewares/requireAuth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'middlewares') 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; -- cgit v1.2.3