mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Support login with github profiles that have no full name
We only really need the email, the rest the user can just fill out manually. So instead of crashing, just leave them empty.
This commit is contained in:
@ -105,7 +105,12 @@ def oauth_login_github(request):
|
||||
# Github just returns full name, so we're just going to have to
|
||||
# split that.
|
||||
r = oa.get('https://api.github.com/user').json()
|
||||
n = r['name'].split(None, 1)
|
||||
if 'name' in r:
|
||||
n = r['name'].split(None, 1)
|
||||
else:
|
||||
# Some github accounts have no name on them, so we can just
|
||||
# let the user fill it out manually in that case.
|
||||
n = ['','']
|
||||
# Email is at a separate endpoint
|
||||
r = oa.get('https://api.github.com/user/emails').json()
|
||||
for e in r:
|
||||
|
Reference in New Issue
Block a user