diff --git a/apps/trust/src/components/RootErrorBoundary.tsx b/apps/trust/src/components/RootErrorBoundary.tsx index 49724072c..dcca8aacc 100644 --- a/apps/trust/src/components/RootErrorBoundary.tsx +++ b/apps/trust/src/components/RootErrorBoundary.tsx @@ -11,7 +11,7 @@ export function RootErrorBoundary() { const search = new URLSearchParams(); - if (location.pathname !== getPathPrefix() || location.search !== "") { + if (location.pathname !== `${getPathPrefix()}/` || location.search !== "") { search.set("continue", window.location.href); } diff --git a/apps/trust/src/hooks/useRequestAccessCallback.ts b/apps/trust/src/hooks/useRequestAccessCallback.ts index b3869d1f5..691c2c8eb 100644 --- a/apps/trust/src/hooks/useRequestAccessCallback.ts +++ b/apps/trust/src/hooks/useRequestAccessCallback.ts @@ -172,7 +172,7 @@ export function useRequestAccessCallback() { } toast(successToastArgs(__)); - window.location.href = window.location.origin + (getPathPrefix() || "/") + location.pathname; + window.location.href = window.location.origin + getPathPrefix() + location.pathname; }, onError: (error) => { toast(errorToastArgs(__, error)); diff --git a/apps/trust/src/pages/auth/ConnectPage.tsx b/apps/trust/src/pages/auth/ConnectPage.tsx index 38c4df023..0ff7c9ff8 100644 --- a/apps/trust/src/pages/auth/ConnectPage.tsx +++ b/apps/trust/src/pages/auth/ConnectPage.tsx @@ -68,13 +68,13 @@ export function ConnectPage(props: { if (continueUrl.origin === window.location.origin && continueUrl.pathname.startsWith(`${getPathPrefix()}/`)) { safeContinueUrl = window.location.origin + continueUrl.pathname + continueUrl.search; } else { - safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); + safeContinueUrl = window.location.origin + getPathPrefix(); } } catch { - safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); + safeContinueUrl = window.location.origin + getPathPrefix(); } } else { - safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); + safeContinueUrl = window.location.origin + getPathPrefix(); } useEffect(() => { diff --git a/apps/trust/src/pages/auth/FullNamePage.tsx b/apps/trust/src/pages/auth/FullNamePage.tsx index 5c477fed3..9c1d8faa9 100644 --- a/apps/trust/src/pages/auth/FullNamePage.tsx +++ b/apps/trust/src/pages/auth/FullNamePage.tsx @@ -40,13 +40,13 @@ export default function FullNamePage() { if (continueUrl.origin === window.location.origin && continueUrl.pathname.startsWith(`${getPathPrefix()}/`)) { safeContinueUrl = window.location.origin + continueUrl.pathname + continueUrl.search; } else { - safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); + safeContinueUrl = window.location.origin + getPathPrefix(); } } catch { - safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); + safeContinueUrl = window.location.origin + getPathPrefix(); } } else { - safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); + safeContinueUrl = window.location.origin + getPathPrefix(); } const { diff --git a/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx b/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx index f085c033a..09b94452d 100644 --- a/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx +++ b/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx @@ -42,7 +42,7 @@ export default function VerifyMagicLinkPagePageMutation() { if (errors) { for (const err of errors) { if (err.extensions?.code === "ALREADY_AUTHENTICATED") { - window.location.href = getPathPrefix() || "/"; + window.location.href = window.location.origin + getPathPrefix(); return; } } @@ -67,10 +67,10 @@ export default function VerifyMagicLinkPagePageMutation() { const continueUrl = new URL(verifyMagicLink.continue, window.location.origin); window.location.href = window.location.origin + continueUrl.pathname + continueUrl.search; } catch { - window.location.href = getPathPrefix() || "/"; + window.location.href = window.location.origin + getPathPrefix(); } } else { - window.location.href = getPathPrefix() || "/"; + window.location.href = window.location.origin + getPathPrefix(); } }, onError: (err) => {