Skip to content

Commit

Permalink
Auth problem: Twitter profile picture
Browse files Browse the repository at this point in the history
This commit does not exist in upstream repo and they asked for a PR.
If we do not submit this to upstream repo and they implement another solution, it will cause conflict and we will get stuck.
  • Loading branch information
entrptaher committed Mar 12, 2019
1 parent e431c92 commit 1a7dc2c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions api/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ const init = () => {
profile.username ||
'';

const photo =
profile.photos &&
profile.photos.length > 0 &&
profile.photos[0].value;

const profilePhoto =
(photo && photo.replace('normal', '400x400')) || null;

const user = {
providerId: profile.id,
fbProviderId: null,
Expand All @@ -113,11 +121,7 @@ const init = () => {
profile.emails.length > 0 &&
profile.emails[0].value) ||
null,
profilePhoto:
(profile.photos &&
profile.photos.length > 0 &&
profile.photos[0].value) ||
null,
profilePhoto,
coverPhoto: profile._json.profile_background_image_url_https
? profile._json.profile_background_image_url_https
: null,
Expand Down

0 comments on commit 1a7dc2c

Please sign in to comment.