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(); const search = new URLSearchParams();
if (location.pathname !== getPathPrefix() || location.search !== "") { if (location.pathname !== `${getPathPrefix()}/` || location.search !== "") {
search.set("continue", window.location.href); search.set("continue", window.location.href);
} }

View File

@@ -172,7 +172,7 @@ export function useRequestAccessCallback() {
} }
toast(successToastArgs(__)); toast(successToastArgs(__));
window.location.href = window.location.origin + (getPathPrefix() || "/") + location.pathname; window.location.href = window.location.origin + getPathPrefix() + location.pathname;
}, },
onError: (error) => { onError: (error) => {
toast(errorToastArgs(__, error)); toast(errorToastArgs(__, error));

View File

@@ -68,13 +68,13 @@ export function ConnectPage(props: {
if (continueUrl.origin === window.location.origin && continueUrl.pathname.startsWith(`${getPathPrefix()}/`)) { if (continueUrl.origin === window.location.origin && continueUrl.pathname.startsWith(`${getPathPrefix()}/`)) {
safeContinueUrl = window.location.origin + continueUrl.pathname + continueUrl.search; safeContinueUrl = window.location.origin + continueUrl.pathname + continueUrl.search;
} else { } else {
safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); safeContinueUrl = window.location.origin + getPathPrefix();
} }
} catch { } catch {
safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); safeContinueUrl = window.location.origin + getPathPrefix();
} }
} else { } else {
safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); safeContinueUrl = window.location.origin + getPathPrefix();
} }
useEffect(() => { useEffect(() => {

View File

@@ -40,13 +40,13 @@ export default function FullNamePage() {
if (continueUrl.origin === window.location.origin && continueUrl.pathname.startsWith(`${getPathPrefix()}/`)) { if (continueUrl.origin === window.location.origin && continueUrl.pathname.startsWith(`${getPathPrefix()}/`)) {
safeContinueUrl = window.location.origin + continueUrl.pathname + continueUrl.search; safeContinueUrl = window.location.origin + continueUrl.pathname + continueUrl.search;
} else { } else {
safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); safeContinueUrl = window.location.origin + getPathPrefix();
} }
} catch { } catch {
safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); safeContinueUrl = window.location.origin + getPathPrefix();
} }
} else { } else {
safeContinueUrl = window.location.origin + (getPathPrefix() || "/"); safeContinueUrl = window.location.origin + getPathPrefix();
} }
const { const {

View File

@@ -42,7 +42,7 @@ export default function VerifyMagicLinkPagePageMutation() {
if (errors) { if (errors) {
for (const err of errors) { for (const err of errors) {
if (err.extensions?.code === "ALREADY_AUTHENTICATED") { if (err.extensions?.code === "ALREADY_AUTHENTICATED") {
window.location.href = getPathPrefix() || "/"; window.location.href = window.location.origin + getPathPrefix();
return; return;
} }
} }
@@ -67,10 +67,10 @@ export default function VerifyMagicLinkPagePageMutation() {
const continueUrl = new URL(verifyMagicLink.continue, window.location.origin); const continueUrl = new URL(verifyMagicLink.continue, window.location.origin);
window.location.href = window.location.origin + continueUrl.pathname + continueUrl.search; window.location.href = window.location.origin + continueUrl.pathname + continueUrl.search;
} catch { } catch {
window.location.href = getPathPrefix() || "/"; window.location.href = window.location.origin + getPathPrefix();
} }
} else { } else {
window.location.href = getPathPrefix() || "/"; window.location.href = window.location.origin + getPathPrefix();
} }
}, },
onError: (err) => { onError: (err) => {