Преглед изворни кода

Merge pull request #9163 from rragundez/default-role

Bug fix, configurable default if using oauth via the `DEFAULT_USER_ROLE` env variable
Timothy Jaeryang Baek пре 3 месеци
родитељ
комит
9b640b0ac2
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      backend/open_webui/utils/oauth.py

+ 2 - 1
backend/open_webui/utils/oauth.py

@@ -82,7 +82,8 @@ class OAuthManager:
             oauth_allowed_roles = auth_manager_config.OAUTH_ALLOWED_ROLES
             oauth_admin_roles = auth_manager_config.OAUTH_ADMIN_ROLES
             oauth_roles = None
-            role = "pending"  # Default/fallback role if no matching roles are found
+            # Default/fallback role if no matching roles are found
+            role = auth_manager_config.DEFAULT_USER_ROLE
 
             # Next block extracts the roles from the user data, accepting nested claims of any depth
             if oauth_claim and oauth_allowed_roles and oauth_admin_roles: