Updated passport local strategy to use usernameEmail usernameField

This commit is contained in:
Sahat Yalkabov
2013-12-04 07:58:17 -05:00
parent 83dbe9c197
commit 12368eaf95
3 changed files with 42 additions and 48 deletions

View File

@ -33,10 +33,7 @@ exports.getLogin = function(req, res) {
*/
exports.postLogin = function(req, res, next) {
passport.authenticate('local', function(err, user, info) {
if (err) {
console.log(err);
return next(err);
}
if (err) return next(err);
if (!user) {
req.flash('messages', info.message);
return res.redirect('/login');