From 12766c1f3e9563034d33a9c8478e2e352beec39a Mon Sep 17 00:00:00 2001 From: Igor Freire Date: Sun, 1 Feb 2015 13:10:41 -0300 Subject: [PATCH] Adjust profile image URLs on Fb and Twitter strategies For Fb, use the Graph API. For twitter, use the 'bigger' profile image. Larger profile images (like the one provided by Google) could provide more flexibility. --- modules/users/server/config/strategies/facebook.js | 2 +- modules/users/server/config/strategies/twitter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/users/server/config/strategies/facebook.js b/modules/users/server/config/strategies/facebook.js index 7acdd217cd..dfec829c79 100644 --- a/modules/users/server/config/strategies/facebook.js +++ b/modules/users/server/config/strategies/facebook.js @@ -29,7 +29,7 @@ module.exports = function(config) { lastName: profile.name.familyName, displayName: profile.displayName, email: profile.emails[0].value, - profileImageURL: (profile.photos && profile.photos.length) ? profile.photos[0].value : undefined, + profileImageURL: (profile.id) ? '//graph.facebook.com/' + profile.id + '/picture?type=large' : undefined, provider: 'facebook', providerIdentifierField: 'id', providerData: providerData diff --git a/modules/users/server/config/strategies/twitter.js b/modules/users/server/config/strategies/twitter.js index f58de392c2..b7d46435b7 100644 --- a/modules/users/server/config/strategies/twitter.js +++ b/modules/users/server/config/strategies/twitter.js @@ -26,7 +26,7 @@ module.exports = function(config) { var providerUserProfile = { displayName: profile.displayName, username: profile.username, - profileImageURL: (profile.photos && profile.photos.length) ? profile.photos[0].value : undefined, + profileImageURL: profile.photos[0].value.replace('normal', 'bigger'), provider: 'twitter', providerIdentifierField: 'id_str', providerData: providerData