您可以使用自定义回调,例如:
passport.authenticate('local', function (err, account) { req.logIn(account, function() { res.status(err ? 500 : 200).send(err ? err : account); });})(this.req, this.res, this.next);在err对象中,您可以找到所有必需的错误,这些错误在身份验证时出现。

您可以使用自定义回调,例如:
passport.authenticate('local', function (err, account) { req.logIn(account, function() { res.status(err ? 500 : 200).send(err ? err : account); });})(this.req, this.res, this.next);在err对象中,您可以找到所有必需的错误,这些错误在身份验证时出现。