fix facebook might not return email
This commit is contained in:
parent
0f71eff531
commit
6a67f7946f
|
@ -86,7 +86,7 @@ def facebook_callback():
|
||||||
"https://graph.facebook.com/me?fields=id,name,email,picture{url}"
|
"https://graph.facebook.com/me?fields=id,name,email,picture{url}"
|
||||||
).json()
|
).json()
|
||||||
|
|
||||||
email = facebook_user_data.get("email").strip().lower()
|
email = facebook_user_data.get("email")
|
||||||
|
|
||||||
# user choose to not share email, cannot continue
|
# user choose to not share email, cannot continue
|
||||||
if not email:
|
if not email:
|
||||||
|
@ -95,6 +95,7 @@ def facebook_callback():
|
||||||
)
|
)
|
||||||
return redirect(url_for("auth.register"))
|
return redirect(url_for("auth.register"))
|
||||||
|
|
||||||
|
email = email.strip().lower()
|
||||||
user = User.get_by(email=email)
|
user = User.get_by(email=email)
|
||||||
|
|
||||||
picture_url = facebook_user_data.get("picture", {}).get("data", {}).get("url")
|
picture_url = facebook_user_data.get("picture", {}).get("data", {}).get("url")
|
||||||
|
|
Loading…
Reference in a new issue