Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve image and gender from FB api call #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kefahi
Copy link

@kefahi kefahi commented Sep 27, 2020

FBUser.picture_url is not filled by the FB api nor is it used. A minor modification was required to retrieve the picture and gender as well.

@@ -20,6 +20,8 @@ class MultiAuth::Provider::Facebook < MultiAuth::Provider
user.last_name = fb_user.last_name
user.location = fb_user.location
user.description = fb_user.about
user.image = fb_user.picture[:data][:url]
user.gender = fb_user.gender if fb_user.gender
Copy link
Owner

Choose a reason for hiding this comment

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

IMO user.gender = fb_user.gender should work, no needs for if

@@ -20,6 +20,8 @@ class MultiAuth::Provider::Facebook < MultiAuth::Provider
user.last_name = fb_user.last_name
user.location = fb_user.location
user.description = fb_user.about
user.image = fb_user.picture[:data][:url]
Copy link
Owner

Choose a reason for hiding this comment

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

this code will raise an exception if fb_user.picture is nil, right? could we avoid it?

@@ -34,7 +36,9 @@ class MultiAuth::Provider::Facebook < MultiAuth::Provider
property raw_json : String?
property access_token : OAuth2::AccessToken?
property picture_url : String?
Copy link
Owner

Choose a reason for hiding this comment

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

let remove it, if it not used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants