This is an automated email from the ASF dual-hosted git repository.
amoghdesai 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 d17ca5c481b Logout functionality should respect base_url in api server
(#49545)
d17ca5c481b is described below
commit d17ca5c481beb984129737d2078834f95e24fecd
Author: Amogh Desai <[email protected]>
AuthorDate: Wed Apr 23 09:49:03 2025 +0530
Logout functionality should respect base_url in api server (#49545)
---
airflow-core/src/airflow/ui/src/layouts/Nav/LogoutModal.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/airflow-core/src/airflow/ui/src/layouts/Nav/LogoutModal.tsx
b/airflow-core/src/airflow/ui/src/layouts/Nav/LogoutModal.tsx
index ba6ae08eca0..97b5e67cb35 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Nav/LogoutModal.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Nav/LogoutModal.tsx
@@ -31,8 +31,12 @@ const LogoutModal: React.FC<LogoutModalProps> = ({ isOpen,
onClose }) => (
<ConfirmationModal
header="Logout"
onConfirm={() => {
+ const baseHref =
document.querySelector("head>base")?.getAttribute("href") ?? "";
+ const baseUrl = new URL(baseHref, globalThis.location.origin);
+ const logoutPath = new URL("api/v2/auth/logout", baseUrl).pathname;
+
localStorage.removeItem(TOKEN_STORAGE_KEY);
- globalThis.location.replace(`/api/v2/auth/logout`);
+ globalThis.location.replace(logoutPath);
}}
onOpenChange={onClose}
open={isOpen}