Skip to content

🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!

Have OIDC first name fallback to name

TECbb886a5ff3c9
diff --git a/backend/oidc_handler.py b/backend/oidc_handler.py
index 7fc1f26..4e5b1a4 100644
--- a/backend/oidc_handler.py
+++ b/backend/oidc_handler.py
@@ -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]