Skip to content

Regression in security iframe navigation logic (ignores basename) #63111

@JC-comp

Description

@JC-comp

Apache Airflow version

3.1.7

If "Other Airflow 3 version" selected, which one?

No response

What happened?

A regression was introduced in PR #58997 regarding how the security iframe handles redirection. The current logic checks for a hardcoded pathname starting with /auth/, which fails when Airflow is configured with a non-root base_url (e.g., when hosted at /airflow/).

const onLoad = () => {
const iframe: HTMLIFrameElement | null = document.querySelector("#security-iframe");
if (iframe?.contentWindow && !iframe.contentWindow.location.pathname.startsWith("/auth/")) {
void Promise.resolve(navigate("/"));
}
};

What you think should happen instead?

No response

How to reproduce

  1. Configure Airflow to run behind a prefix (e.g., AIRFLOW__API__BASE_URL=/airflow).
  2. Access the UI and navigate to security tabs.
  3. The onLoad handler in the security iframe triggers.
  4. iframe.contentWindow.location.pathname returns /airflow/auth/....
  5. The check .startsWith("/auth/") returns false.
  6. The router incorrectly calls navigate("/"), redirecting the user to the root instead of the dashboard.

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:UIRelated to UI/UX. For Frontend Developers.area:autharea:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions