jedcunningham commented on code in PR #47514:
URL: https://github.com/apache/airflow/pull/47514#discussion_r1985684972


##########
airflow/auth/managers/simple/routes/login.py:
##########
@@ -40,6 +43,27 @@ def create_token(
     return SimpleAuthManagerLogin.create_token(body=body)
 
 
+@login_router.get(
+    "/token",
+    status_code=status.HTTP_201_CREATED,
+    responses=create_openapi_http_exception_doc([status.HTTP_400_BAD_REQUEST, 
status.HTTP_401_UNAUTHORIZED]),

Review Comment:
   These don't seem right, isn't is 307 or 403?



##########
airflow/auth/managers/simple/simple_auth_manager.py:
##########
@@ -126,7 +126,11 @@ def init(self) -> None:
 
     def get_url_login(self, **kwargs) -> str:
         """Return the login page url."""
-        return "/auth/webapp/login"
+        is_simple_auth_manager_all_admins = conf.getboolean("core", 
"simple_auth_manager_all_admins")
+        if is_simple_auth_manager_all_admins:
+            return "/auth/token"
+        else:
+            return "/auth/login"

Review Comment:
   ```suggestion
           if conf.getboolean("core", "simple_auth_manager_all_admins")
               return "/auth/token"
   
           return "/auth/login"
   ```



##########
airflow/auth/managers/simple/simple_auth_manager.py:
##########
@@ -126,7 +126,11 @@ def init(self) -> None:
 
     def get_url_login(self, **kwargs) -> str:
         """Return the login page url."""
-        return "/auth/webapp/login"
+        is_simple_auth_manager_all_admins = conf.getboolean("core", 
"simple_auth_manager_all_admins")
+        if is_simple_auth_manager_all_admins:
+            return "/auth/token"
+        else:
+            return "/auth/login"

Review Comment:
   nit, take it or leave it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to