use github email that is "verified" and "primary"

This commit is contained in:
Son NK 2020-03-05 16:45:49 +01:00
parent ca70d26285
commit 90dc05725a

View file

@ -59,7 +59,6 @@ def github_callback():
# a dict with "name", "login" # a dict with "name", "login"
github_user_data = github.get("https://api.github.com/user").json() github_user_data = github.get("https://api.github.com/user").json()
LOG.d("user login with github %s", github_user_data)
# return list of emails # return list of emails
# { # {
@ -74,7 +73,7 @@ def github_callback():
email = None email = None
for e in emails: for e in emails:
if e.get("verified"): if e.get("verified") and e.get("primary"):
email = e.get("email") email = e.get("email")
break break