【发布时间】:2018-02-20 01:10:00
【问题描述】:
我正在使用 Passport.js,但是当我进入 else 时,如果它给了我未经授权的错误。我们在这里调用网络服务。当我进入 else if(exists) 时,我想发送响应 oto webservice。有什么想法吗?
passport.use('local-signup-nti', new LocalStrategy({
// by default, local strategy uses username and password, we will override with email
usernameField: 'email',
passwordField: 'password',
passReqToCallback: true // allows us to pass back the entire request to the callback
},
function (req, email, password, done) {
user.emailExists(email, function (err, exists) {
if (err)
return done(err);
else if (exists) {
req.userDetails=1;
return done(err, req.userDetails);
} else {
}
【问题讨论】:
标签: node.js passport.js passport-local