Created
October 23, 2015 17:39
-
-
Save RubyRonin/fbd7e85d4216522368ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passport.use('custom-login', new Custom(function (req, done) { | |
var email = req.param('email'), | |
pw = req.param('password'); | |
User.findOne({"local.email": email}, function (err, usr) { | |
if (err){ | |
console.log(err); | |
return done(err); | |
} | |
if (!usr) | |
{ | |
return done(null, false, req.flash('loginMessage', 'BITCH PLEASE: Invalid credentials, please try again.')); | |
} | |
if (!usr.validPassword(pw)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment