Skip to content

Commit 3fd33c4

Browse files
amoghrajeshSneha Prabhu
authored and
Sneha Prabhu
committed
Logout functionality should respect base_url in api server (apache#49545)
1 parent 4aa519b commit 3fd33c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

airflow-core/src/airflow/ui/src/layouts/Nav/LogoutModal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ const LogoutModal: React.FC<LogoutModalProps> = ({ isOpen, onClose }) => (
3131
<ConfirmationModal
3232
header="Logout"
3333
onConfirm={() => {
34+
const baseHref = document.querySelector("head>base")?.getAttribute("href") ?? "";
35+
const baseUrl = new URL(baseHref, globalThis.location.origin);
36+
const logoutPath = new URL("api/v2/auth/logout", baseUrl).pathname;
37+
3438
localStorage.removeItem(TOKEN_STORAGE_KEY);
35-
globalThis.location.replace(`/api/v2/auth/logout`);
39+
globalThis.location.replace(logoutPath);
3640
}}
3741
onOpenChange={onClose}
3842
open={isOpen}

0 commit comments

Comments
 (0)