From 79b9c8a677796c11c7f44f40b5be7500920c53b3 Mon Sep 17 00:00:00 2001 From: "Willnow, Patrick" Date: Fri, 4 Oct 2024 00:05:36 +0200 Subject: [PATCH] handling no claim received when nested expected --- backend/open_webui/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 6b601d446..551357f90 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -2253,7 +2253,7 @@ async def oauth_callback(provider: str, request: Request, response: Response): elif webui_app.state.config.ENABLE_OAUTH_ROLE_MAPPING: oauth_claim = webui_app.state.config.OAUTH_ROLES_CLAIM oauth_roles = user_data.get(oauth_claim) # Works for simple claims with no nesting - if "." in oauth_claim: + if oauth_roles and "." in oauth_claim: # Implementation to handle nested claims of arbitrary depth nested_claims = oauth_claim.split(".") claim_data = user_data.get(nested_claims[0])