Skip to content

Commit

Permalink
what
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Sevilleja committed Feb 4, 2014
1 parent 3d797de commit c153c71
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions config/passport.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,30 +74,6 @@ module.exports = function(passport) {
},
function(req, email, password, done) {

<<<<<<< HEAD
// asynchronous
process.nextTick(function() {

// find a user whose email is the same as the forms email
// we are checking to see if the user trying to login already exists
User.findOne({ 'local.email' : email }, function(err, user) {
// if there are any errors, return the error before anything else
if (err)
return done(err);

// if no user is found, return the message
if (!user)
return done(null, false, req.flash('loginMessage', 'No user found.')); // req.flash is the way to set flashdata using connect-flash

// if the user is found but the password is wrong
if (!user.validPassword(password))
return done(null, false, req.flash('loginMessage', 'Oops! Wrong password.')); // create the loginMessage and save it to session as flashdata

// all is well, return successful user
return done(null, user);
});

=======
// asynchronous
process.nextTick(function() {
// check if the user is already logged ina
Expand Down Expand Up @@ -139,7 +115,7 @@ module.exports = function(passport) {
});

}
>>>>>>> linking

});

}));
Expand Down

0 comments on commit c153c71

Please sign in to comment.