pierrejeambrun commented on code in PR #49545:
URL: https://github.com/apache/airflow/pull/49545#discussion_r2054315215
##########
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:
The utility function should be used across main and this one. We can merge
that now to fix the issue, and we can always cleanup in follow up PRs if you'd
like
--
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]