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

pierrejeambrun pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-1-test by this push:
     new 2ba67b6054c [v3-1-test] Fix regression in security iframe navigation 
logic with basename (#63141) (#63453)
2ba67b6054c is described below

commit 2ba67b6054c5f22b26cbcdbeb57d25867847d703
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Mar 16 12:01:51 2026 +0100

    [v3-1-test] Fix regression in security iframe navigation logic with 
basename (#63141) (#63453)
    
    * [v3-1-test] 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
    (cherry picked from commit 8653aa84ff4d330eecae2435a69de207de54502d)
    
    Co-authored-by: Subham <[email protected]>
    
    * Delete airflow-core/newsfragments/63141.bugfix.rst
    
    ---------
    
    Co-authored-by: Subham <[email protected]>
    Co-authored-by: Jens Scheffler <[email protected]>
    Co-authored-by: Jarek Potiuk <[email protected]>
    Co-authored-by: Pierre Jeambrun <[email protected]>
---
 airflow-core/src/airflow/ui/src/pages/Security.tsx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

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