We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per comment in jaredhanson/passport-local#8.
The text was updated successfully, but these errors were encountered:
I'm edge-casey on this one. If an app really needs to do this, I'd suggest setting the passReqToCallback option, as so:
passReqToCallback
passport.use(new LocalStrategy({ passReqToCallback: true } function(req, username, password, done) { User.findOne({ username: username }, function (err, user) { if (err) { return done(err); } if (!user) { return done(null, false); } if (!user.verifyPassword(password)) { req.flash('error', 'Your password is too long'); req.flash('error, 'Also, it is too short!!!'); return done(null, false); } return done(null, user); }); } ));
req becomes the first argument to the verify callback, and you can use it to flash messages to your heart's content.
req
If enough people +1 this, I'll consider it.
Sorry, something went wrong.
No branches or pull requests
Per comment in jaredhanson/passport-local#8.
The text was updated successfully, but these errors were encountered: