Open Rukeith opened 9 years ago
:+1:
+1 Any update on that?
I had a similar issue. All I got back was profile = {id: facebookId, name: fullName}. I forked the project, changed v2.2 to v2.5 in '/lib/strategy.js', and the profile came back with all the fields I asked for. Hope this helps!
I don't see what the problem is? You can just overwrite the profileUrl
and attach the fields that you like as parameters:
passport.use(new FacebookStrategy({
clientID: 'xxxxxxxx',
clientSecret: 'xxxxxxxxxxx',
callbackURL: "http://localhost:3000/auth/facebook/callback",
profileURL: 'https://graph.facebook.com/v2.5/me?fields=email',
enableProof: false
},
function(accessToken, refreshToken, profile, done) {
return done(null, profile);
}
));
Amberlamps,
Not work for me. I tried: profileURL: 'https://graph.facebook.com/v2.5/me', profileFields: ['id', 'displayName','gender','emails','birthday','location']
But emails, birthday and location don't come.
Well, this is not what I wrote. Even though your solution should work, when I take a look at the code solely, I suggested to put the fields in profileURL
directly, like "profileURL": "https://graph.facebook.com/v2.5/me?fields=email,birthday"
.
I saw the facebook api will update to v2.4 I use passport-facebook to make a simple sign up website But it showed up the module still use v2.2
I have modify the version 2.2 to 2.3 and v2.4 it doesn't work. I recommend this part can be updated, or I can send a pull request to it ?