Retrieve image and gender from FB api call#21
Open
kefahi wants to merge 2 commits intomsa7:masterfrom
Open
Conversation
msa7
requested changes
Sep 28, 2020
src/multi_auth/providers/facebook.cr
Outdated
| 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 |
Owner
There was a problem hiding this comment.
IMO user.gender = fb_user.gender should work, no needs for if
| user.last_name = fb_user.last_name | ||
| user.location = fb_user.location | ||
| user.description = fb_user.about | ||
| user.image = fb_user.picture[:data][:url] |
Owner
There was a problem hiding this comment.
this code will raise an exception if fb_user.picture is nil, right? could we avoid it?
src/multi_auth/providers/facebook.cr
Outdated
| @@ -34,7 +36,9 @@ class MultiAuth::Provider::Facebook < MultiAuth::Provider | |||
| property raw_json : String? | |||
| property access_token : OAuth2::AccessToken? | |||
| property picture_url : String? | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FBUser.picture_urlis not filled by the FB api nor is it used. A minor modification was required to retrieve the picture and gender as well.