vincbeck commented on code in PR #77796:
URL: https://github.com/apache/airflow/pull/77796#discussion_r4743501756


##########
airflow-core/src/airflow/api_fastapi/core_api/security.py:
##########
@@ -187,7 +188,13 @@ def collect_request_tokens(
     candidates: list[str | None] = []
     if bearer_credentials and bearer_credentials.scheme.lower() == "bearer":
         candidates.append(bearer_credentials.credentials)
-    candidates.append(request.cookies.get(COOKIE_NAME_JWT_TOKEN))
+    # A browser holding ``_token`` cookies for several paths sends them all. 
We can't use
+    # ``request.cookies`` because Starlette only keeps the last one.

Review Comment:
   `get_user`, `JWTRefreshMiddleware` and `team_authorization.py` still use 
`request.cookies.get(COOKIE_NAME_JWT_TOKEN)`, so they keep the last cookie. 
Browsers send the longer path first, so with an old `_token` at `/` that is the 
stale one. Should they read the cookies the same way? We can do it as a 
follow-up.



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