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

feat(users): get profile picture from provider in oauth signup #1571

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ exports.saveOAuthUserProfile = function (req, providerUserProfile, done) {
lastName: providerUserProfile.lastName,
username: availableUsername,
displayName: providerUserProfile.displayName,
profileImageURL: providerUserProfile.profileImageURL,
profileImageURL: providerUserProfile.providerData.image.url,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is only present on Google+. I tested with Facebook, Twitter, Google+, and GitHub. This breaks the authentication for each one that I tested, other than Google+. Also, the Google+ authenticates but the image reference is incorrect. The url has a "http://localhost" prepended to the url coming from the provider. This actually seems to be an issue in the current master without this change.

@itelo Can you look into whether or not there's a way to reconcile these urls, by inspecting the providerUserProfile fields that are returned for these provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mleanos I found a strange bug, I'll cancel the PR until better understand what 's happening

provider: providerUserProfile.provider,
providerData: providerUserProfile.providerData
});
Expand Down