lundi 2 mars 2015

Facebook Graph API v 2.2 with passport.js: profile picture returns undefined

I'm using passport.js to perform Facebook authentication in node.js. Everything works fine except user profile picture. I tried these approaches:



user.facebook.picture = profile.user_photos[0].value;

user.facebook.picture = 'http://ift.tt/wljqS4' + user.facebook.id + '/picture?height=350&width=250';


And also adding access token:



user.facebook.picture = 'http://ift.tt/wljqS4' + user.facebook.id + '/picture?height=350&width=250' + "&access_token=" + user.facebook.token;


However, on clientside facebook picture returns undefined. What might be the possible solution?


Aucun commentaire:

Enregistrer un commentaire