mirror of
https://github.com/simple-login/app.git
synced 2024-11-11 01:42:54 +08:00
use github email that is "verified" and "primary"
This commit is contained in:
parent
ca70d26285
commit
90dc05725a
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue