Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit 12766c1

Browse files
committed
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.
1 parent 1e450b4 commit 12766c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/users/server/config/strategies/facebook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function(config) {
2929
lastName: profile.name.familyName,
3030
displayName: profile.displayName,
3131
email: profile.emails[0].value,
32-
profileImageURL: (profile.photos && profile.photos.length) ? profile.photos[0].value : undefined,
32+
profileImageURL: (profile.id) ? '//graph.facebook.com/' + profile.id + '/picture?type=large' : undefined,
3333
provider: 'facebook',
3434
providerIdentifierField: 'id',
3535
providerData: providerData

modules/users/server/config/strategies/twitter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = function(config) {
2626
var providerUserProfile = {
2727
displayName: profile.displayName,
2828
username: profile.username,
29-
profileImageURL: (profile.photos && profile.photos.length) ? profile.photos[0].value : undefined,
29+
profileImageURL: profile.photos[0].value.replace('normal', 'bigger'),
3030
provider: 'twitter',
3131
providerIdentifierField: 'id_str',
3232
providerData: providerData

0 commit comments

Comments
 (0)