From 90dc05725a9e754f1abcd2a3a41f4ade7f5a7ffa Mon Sep 17 00:00:00 2001 From: Son NK Date: Thu, 5 Mar 2020 16:45:49 +0100 Subject: [PATCH] use github email that is "verified" and "primary" --- app/auth/views/github.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/auth/views/github.py b/app/auth/views/github.py index 618c3259..7afb392c 100644 --- a/app/auth/views/github.py +++ b/app/auth/views/github.py @@ -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