sjyangkevin commented on code in PR #77619:
URL: https://github.com/apache/airflow/pull/77619#discussion_r4720898219


##########
providers/fab/src/airflow/providers/fab/auth_manager/api_fastapi/routes/login.py:
##########
@@ -129,22 +131,20 @@ def create_token_cli(request: Request, body: dict[str, 
Any] = Body(...)) -> Logi
     status_code=status.HTTP_307_TEMPORARY_REDIRECT,
 )
 def logout(request: Request) -> RedirectResponse:
-    """Clear session cookies and redirect to the login page."""
-    with _get_flask_app().app_context(), _release_scoped_session():
-        login_url = get_auth_manager().get_url_login()
-        secure = request.base_url.scheme == "https" or bool(conf.get("api", 
"ssl_cert", fallback=""))
-        cookie_path = get_cookie_path()
-        response = RedirectResponse(login_url)
-        response.delete_cookie(
-            key="session",
-            path=cookie_path,
-            secure=secure,
-            httponly=True,
-        )
-        response.delete_cookie(
-            key=COOKIE_NAME_JWT_TOKEN,
-            path=cookie_path,
-            secure=secure,
-            httponly=True,
-        )
-        return response
+    """Clear the API token cookie and redirect to the Flask logout view, which 
ends the session."""
+    # The trailing slash routes to the Flask app's own logout view. The 
``session`` cookie is
+    # left in place so that the browser sends it there and the Flask session 
it points at is
+    # signed out.
+    flask_logout_url = urljoin(
+        get_fab_auth_manager().apiserver_endpoint, 
f"{AUTH_MANAGER_FASTAPI_APP_PREFIX}/logout/"
+    )

Review Comment:
   thanks! change applied.



-- 
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