您需要通过将
return
关键字或代码将在其他语句中运行。
if (error === null) {
return res.status(401).render('login', {
message: 'Email or Password is incorrect'
})
}
或
if (error === null) {
res.status(401).render('login', {
message: 'Email or Password is incorrect'
})
return
}