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


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

Review Comment:
   With the latest commit.
   
   Before logout
   
   <img width="1476" height="687" alt="Screenshot from 2026-11-26 16-40-10" 
src="https://github.com/user-attachments/assets/833cd409-593e-44a8-81c7-50748657ef89";
 />
   
   After logout 
   
   <img width="1476" height="687" alt="Screenshot from 2026-11-26 16-40-23" 
src="https://github.com/user-attachments/assets/2583939f-332b-465d-b442-62771b9e613c";
 />
   



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