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();
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -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(() => {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user