Fix usage of getPathPrefix
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user