Ver código fonte

Configurable default role for oauth

Rodrigo Agundez 3 meses atrás
pai
commit
681851ca6b
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      backend/open_webui/utils/oauth.py

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

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