pierrejeambrun commented on code in PR #49545:
URL: https://github.com/apache/airflow/pull/49545#discussion_r2053940492
##########
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:
Nit: I think we should extract a small utility function for this piece of
code. To not duplicate it from the `main.tsx` file.
Basically something like. `getRedictPath(targetPath)`. (That will read the
tag and take this into account.
--
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]