This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8653aa84ff4 Fix regression in security iframe navigation logic with 
basename (#63141)
8653aa84ff4 is described below

commit 8653aa84ff4d330eecae2435a69de207de54502d
Author: Subham <[email protected]>
AuthorDate: Thu Mar 12 20:40:07 2026 +0530

    Fix regression in security iframe navigation logic with basename (#63141)
    
    * Fix regression in security iframe navigation logic with basename
    
    * style: apply formatting to Security.tsx
    
    * fix(ui): remove hardcoded localhost fallback from Security iframe 
navigation
    
    * Add newsfragment for security iframe basename fix
    
    * Address review feedback: simplify security iframe navigation logic and 
handle basename
---
 airflow-core/newsfragments/63141.bugfix.rst        |  1 +
 airflow-core/src/airflow/ui/src/pages/Security.tsx | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/airflow-core/newsfragments/63141.bugfix.rst 
b/airflow-core/newsfragments/63141.bugfix.rst
new file mode 100644
index 00000000000..c9855b3f5e4
--- /dev/null
+++ b/airflow-core/newsfragments/63141.bugfix.rst
@@ -0,0 +1 @@
+Fix security iframe navigation when AIRFLOW__API__BASE_URL basename is 
configured
diff --git a/airflow-core/src/airflow/ui/src/pages/Security.tsx 
b/airflow-core/src/airflow/ui/src/pages/Security.tsx
index 011c1018686..c3b0fb89309 100644
--- a/airflow-core/src/airflow/ui/src/pages/Security.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Security.tsx
@@ -17,8 +17,7 @@
  * under the License.
  */
 import { Box } from "@chakra-ui/react";
-import { useParams } from "react-router-dom";
-import { useNavigate } from "react-router-dom";
+import { useNavigate, useParams } from "react-router-dom";
 
 import { useAuthLinksServiceGetAuthMenus } from "openapi/queries";
 import { ProgressBar } from "src/components/ui";
@@ -43,8 +42,12 @@ export const Security = () => {
   const onLoad = () => {
     const iframe: HTMLIFrameElement | null = 
document.querySelector("#security-iframe");
 
-    if (iframe?.contentWindow && 
!iframe.contentWindow.location.pathname.startsWith("/auth/")) {
-      void Promise.resolve(navigate("/"));
+    if (iframe?.contentWindow) {
+      const base = new URL(document.baseURI).pathname.replace(/\/$/u, ""); // 
Remove trailing slash if exists
+
+      if (!iframe.contentWindow.location.pathname.startsWith(`${base}/auth/`)) 
{
+        void navigate("/");
+      }
     }
   };
 

Reply via email to