Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { t } from "@lingui/core/macro";
import { Trans } from "@lingui/react/macro";
import type { UserInfo } from "@repo/infrastructure/auth/AuthenticationProvider";
import { loggedInPath } from "@repo/infrastructure/auth/constants";
import { useUserInfo } from "@repo/infrastructure/auth/hooks";
import { Badge } from "@repo/ui/components/Badge";
import { Button } from "@repo/ui/components/Button";
Expand Down Expand Up @@ -270,11 +271,10 @@ export default function TenantSelector({ onShowInvitationDialog, variant = "defa
setIsSwitching(true);
},
onSuccess: () => {
// Keep the loader visible briefly before redirecting
// Stay on the same path, but default to loggedInPath if on root
// Don't set isSwitching to false here - let the redirect handle it
setTimeout(() => {
window.location.href = "/";
}, 250);
const targetPath = window.location.pathname === "/" ? loggedInPath : window.location.pathname;
window.location.href = targetPath;
},
onError: () => {
// Hide the loader on error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { t } from "@lingui/core/macro";
import { loggedInPath } from "@repo/infrastructure/auth/constants";
import { useUserInfo } from "@repo/infrastructure/auth/hooks";
import { SideMenu } from "@repo/ui/components/SideMenu";
import { useState } from "react";
Expand Down Expand Up @@ -30,10 +31,9 @@ export default function FederatedSideMenu({ currentSystem }: Readonly<FederatedS
setIsSwitching(true);
},
onSuccess: () => {
// Keep the loader visible briefly before redirecting
setTimeout(() => {
window.location.href = "/";
}, 250);
// Stay on the same path, but default to loggedInPath if on root
const targetPath = globalThis.location.pathname === "/" ? loggedInPath : globalThis.location.pathname;
globalThis.location.href = targetPath;
},
onError: () => {
setIsSwitching(false);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading