Skip to content

Commit

Permalink
Merge pull request #355 from minilikmila/fix/facebook-login
Browse files Browse the repository at this point in the history
Modify the Facebook login authentication callback to enable user email access through the response body.
  • Loading branch information
lakhansamani authored May 29, 2023
2 parents 1a5b446 + 0fde46d commit 6c9b359
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/handlers/oauth_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ func processFacebookUserInfo(code string) (models.User, error) {
userRawData := make(map[string]interface{})
json.Unmarshal(body, &userRawData)

email := fmt.Sprintf("%v", userRawData["sub"])
email := fmt.Sprintf("%v", userRawData["email"])

picObject := userRawData["picture"].(map[string]interface{})["data"]
picDataObject := picObject.(map[string]interface{})
Expand Down

0 comments on commit 6c9b359

Please sign in to comment.