mirror of
https://github.com/sassanix/Warracker.git
synced 2025-12-30 10:09:54 -06:00
Have OIDC first name fallback to name
If given/family names are unset, it seems reasonable to default to the first name.
This commit is contained in:
@@ -229,6 +229,9 @@ def oidc_callback_route():
|
||||
|
||||
first_name = token_id_claims.get('given_name') or userinfo.get('given_name', '')
|
||||
last_name = token_id_claims.get('family_name') or userinfo.get('family_name', '')
|
||||
|
||||
if not first_name and not last_name:
|
||||
first_name = token_id_claims.get('name') or userinfo.get('name', '')
|
||||
|
||||
cur.execute('SELECT COUNT(*) FROM users')
|
||||
user_count = cur.fetchone()[0]
|
||||
|
||||
Reference in New Issue
Block a user