mirror of
https://github.com/open-webui/open-webui
synced 2024-11-07 00:59:52 +00:00
fix logic
This commit is contained in:
parent
79b9c8a677
commit
6ddd8c7241
@ -2256,9 +2256,11 @@ async def oauth_callback(provider: str, request: Request, response: Response):
|
||||
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])
|
||||
for nested_claim in nested_claims[1:]:
|
||||
claim_data = user_data
|
||||
for nested_claim in nested_claims:
|
||||
claim_data = claim_data.get(nested_claim)
|
||||
if claim_data is None:
|
||||
break
|
||||
oauth_roles = claim_data
|
||||
|
||||
log.info(f"User {user.name} has OAuth roles: {oauth_roles}")
|
||||
|
Loading…
Reference in New Issue
Block a user