Fix usage of getPathPrefix

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-03-13 14:15:10 +04:00
parent 6db862b470
commit 5188f9638b
5 changed files with 11 additions and 11 deletions

View File

@@ -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);
}

View File

@@ -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));

View File

@@ -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(() => {

View File

@@ -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 {

View File

@@ -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) => {