mirror of
https://github.com/simple-login/app.git
synced 2024-09-21 07:25:59 +08:00
use github email that is "verified" and "primary"
This commit is contained in:
parent
ca70d26285
commit
90dc05725a
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue