When using a standard expressroute for this login, I have noticed that even if the req.body.password is incorrect, I am still getting redirected to '/login'.
router.post('/student/login', (req, res) => {
if (req.body.password === 'password') {
return res.status(200).redirect('/login')
} else {
return res.status(401).redirect('/landingpage')
}
})
What could be causing this unexpected behavior?