stephen-bracken commented on code in PR #70783:
URL: https://github.com/apache/airflow/pull/70783#discussion_r3692298753


##########
airflow-core/src/airflow/api_fastapi/core_api/app.py:
##########
@@ -172,12 +172,15 @@ def init_config(app: FastAPI) -> None:
 
 def init_middlewares(app: FastAPI) -> None:
     from airflow.api_fastapi.app import get_auth_manager
-    from airflow.api_fastapi.auth.middlewares.refresh_token import 
JWTRefreshMiddleware
     from airflow.api_fastapi.common.http_access_log import 
HttpAccessLogMiddleware
 
-    app.add_middleware(JWTRefreshMiddleware)
+    auth_manager = get_auth_manager()
 
-    for middleware_cls, middleware_kwargs in 
get_auth_manager().get_fastapi_middlewares():
+    jwt_refresh_middleware, jwt_refresh_middleware_kwargs = 
auth_manager.get_jwt_refresh_middleware()
+
+    app.add_middleware(jwt_refresh_middleware, **jwt_refresh_middleware_kwargs)
+
+    for middleware_cls, middleware_kwargs in 
auth_manager.get_fastapi_middlewares():

Review Comment:
   sure, I'll give it a go here



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