mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Handle OAuth providers that return NULL for first or last name
We already handled those that returns empty, but it appears that at least Microsoft can also return null/None. If those show up, just treat them as empty.
This commit is contained in:
@ -53,8 +53,8 @@ def _login_oauth(request, provider, authurl, tokenurl, scope, authdatafunc):
|
||||
# handled elsewhere, so store the details we got from
|
||||
# the oauth login in the session, and pass the user on.
|
||||
request.session['oauth_email'] = email
|
||||
request.session['oauth_firstname'] = firstname
|
||||
request.session['oauth_lastname'] = lastname
|
||||
request.session['oauth_firstname'] = firstname or ''
|
||||
request.session['oauth_lastname'] = lastname or ''
|
||||
return HttpResponseRedirect('/account/signup/oauth/')
|
||||
|
||||
log.info("Oauth signin of {0} using {1} from {2}.".format(email, provider, get_client_ip(request)))
|
||||
|
Reference in New Issue
Block a user