mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
Enable Retrieving Username Claim from Userinfo Endpoint
This commit is contained in:
parent
438e5d966f
commit
2011e5711d
1 changed files with 5 additions and 1 deletions
|
|
@ -355,7 +355,11 @@ class OAuthManager:
|
|||
log.warning(f"OAuth callback error: {e}")
|
||||
raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_CRED)
|
||||
user_data: UserInfo = token.get("userinfo")
|
||||
if not user_data or auth_manager_config.OAUTH_EMAIL_CLAIM not in user_data:
|
||||
if (
|
||||
(not user_data) or
|
||||
(auth_manager_config.OAUTH_EMAIL_CLAIM not in user_data) or
|
||||
(auth_manager_config.OAUTH_USERNAME_CLAIM not in user_data)
|
||||
):
|
||||
user_data: UserInfo = await client.userinfo(token=token)
|
||||
if not user_data:
|
||||
log.warning(f"OAuth callback failed, user data is missing: {token}")
|
||||
|
|
|
|||
Loading…
Reference in a new issue