Fixed Twitter auth "findUserOrCreate"

This commit is contained in:
Sahat Yalkabov
2013-12-02 19:20:57 -05:00
parent cab3e31e3f
commit 179138f1b5

View File

@ -70,7 +70,7 @@ passport.use(new TwitterStrategy({
callbackURL: '/auth/twitter/callback'
},
function(token, tokenSecret, profile, done) {
User.findOne({ facebook: profile.id }, function(err, existingUser) {
User.findOne({ twitter: profile.id }, function(err, existingUser) {
if (err) done(err);
if (existingUser) return done(null, existingUser);
console.log(profile);