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
1 changed files with 1 additions and 2 deletions

View File

@ -59,7 +59,6 @@ def github_callback():
# a dict with "name", "login"
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
# {
@ -74,7 +73,7 @@ def github_callback():
email = None
for e in emails:
if e.get("verified"):
if e.get("verified") and e.get("primary"):
email = e.get("email")
break