mirror of
https://github.com/open-webui/open-webui
synced 2025-04-08 14:49:46 +00:00
Merge pull request #8493 from kyunwang/fix/oidc-500-error-name-field
fix: Check OAuth name type with fallback
This commit is contained in:
commit
be665f2a3e
@ -276,8 +276,13 @@ class OAuthManager:
|
||||
picture_url = ""
|
||||
if not picture_url:
|
||||
picture_url = "/user.png"
|
||||
|
||||
username_claim = auth_manager_config.OAUTH_USERNAME_CLAIM
|
||||
|
||||
name = user_data.get(username_claim)
|
||||
if not isinstance(user, str):
|
||||
name = email
|
||||
|
||||
role = self.get_user_role(None, user_data)
|
||||
|
||||
user = Auths.insert_new_auth(
|
||||
@ -285,7 +290,7 @@ class OAuthManager:
|
||||
password=get_password_hash(
|
||||
str(uuid.uuid4())
|
||||
), # Random password, not used
|
||||
name=user_data.get(username_claim, "User"),
|
||||
name=name,
|
||||
profile_image_url=picture_url,
|
||||
role=role,
|
||||
oauth_sub=provider_sub,
|
||||
|
Loading…
Reference in New Issue
Block a user