amoghrajesh commented on code in PR #49545:
URL: https://github.com/apache/airflow/pull/49545#discussion_r2054259809
##########
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 sure we can do that. But you mean only for this one occurence right? Or
reuse that function across main.tsx and this one?
--
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]