diff --git a/routes/login.js b/routes/login.js index d8d4828..15ea22c 100644 --- a/routes/login.js +++ b/routes/login.js @@ -41,10 +41,9 @@ router.post('/', csrfProtection, loginValidators, asyncHandler(async (req,res,ne if (user !== null ) { // const userPassword = await db.User.findOne({where: {password}}) ; if(userPassword === password) { - loginUser(req, res, user); - res.redirect('/'); + loginUser(req, res, user); + return res.redirect('/'); } - } errors.push('Login failed') } else {