.post(passport.authenticate('local'), function (req, res, next) {
// access the authenticate username and password.
if (!req.user.active) { // have not been active.
req.logout(); // delete req.user & clear login session
res.status(400);
return res.send('Unactived');
}
res.end();
});
你的路由地址貌似没写
end 方法是结束当前的请求并返回相应数据,也就是说你当前的地址是啥就是啥,你说的重定向可以试试这个方法redirect
res.end()就是把response进程结束了吧,如果要重定向用res.redirect()。