Procházet zdrojové kódy

Allow /api/token/auth can create user or make it active when auto login enabled (#2420)

Ying Chen před 4 roky
rodič
revize
11b89004f9
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      desktop/core/src/desktop/middleware.py

+ 3 - 1
desktop/core/src/desktop/middleware.py

@@ -308,7 +308,9 @@ class LoginAndPermissionMiddleware(MiddlewareMixin):
     if request.path in ['/oidc/authenticate/', '/oidc/callback/', '/oidc/logout/', '/hue/oidc_failed/']:
       return None
 
-    if request.path.startswith('/api/'):
+    if AUTH.AUTO_LOGIN_ENABLED.get() and request.path.startswith('/api/token/auth'):
+      pass # allow /api/token/auth can create user or make it active
+    elif request.path.startswith('/api/'):
       return None
 
     # Skip views not requiring login