-
-
Save rlemon/bd5bc70efd4b1f9eacc4 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(new LocalStrategy(function(username, password, done) { | |
console.log('this logs every time'); | |
client.queryAsync({ | |
text: 'SELECT * FROM subscribers WHERE username = $1', | |
name: 'get user info', | |
values: [username] | |
}).then(function(results) { | |
var user = results.rows[0]; | |
console.log('this does not log after it "breaks"'); | |
if( !user || !passwordHash.verify(password, user.password) ) { | |
return done(null, false, {message: 'invalid username or password'}); | |
} | |
return done(null, user); | |
}).catch(function(err) { | |
console.log('this never logs'); | |
return done(null, false, {message:'error collecting user'}) | |
}); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment