This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new ef1f950 name and email might not always be passed to us
ef1f950 is described below
commit ef1f950ffe42dd4f7815afdd7da7a89fb872eb8e
Author: Daniel Gruno <[email protected]>
AuthorDate: Tue Sep 8 11:32:38 2020 +0200
name and email might not always be passed to us
---
server/plugins/oauthGithub.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/server/plugins/oauthGithub.py b/server/plugins/oauthGithub.py
index 3cdd348..91c698a 100644
--- a/server/plugins/oauthGithub.py
+++ b/server/plugins/oauthGithub.py
@@ -31,7 +31,11 @@ async def process(
"https://api.github.com/user",
headers={"authorization": "token %s" % m.group(1)},
)
+
js = rv.json()
js["oauth_domain"] = "github.com"
+ # Full name and email address might not always be available to us.
Fake it till you make it.
+ js["name"] = js["name"] or js["login"]
+ js["email"] = js["email"] or "%[email protected]" % js["login"]
return js
return None