amoghrajesh commented on code in PR #49545:
URL: https://github.com/apache/airflow/pull/49545#discussion_r2055219596


##########
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);

Review Comment:
   Yeah makes sense. Let me clean it in a follow uo



##########
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);

Review Comment:
   Yeah makes sense. Let me clean it in a follow up



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to