fix: add check to make sure the url can be parsed

This commit is contained in:
Stavros
2025-02-11 18:50:33 +02:00
parent 3c9bc8c67f
commit b1dc5cb4cc

View File

@@ -31,9 +31,7 @@ export const ContinuePage = () => {
}, 500); }, 500);
}; };
const uri = new URL(redirectUri); if (!URL.canParse(redirectUri)) {
if (uri === null) {
return ( return (
<ContinuePageLayout> <ContinuePageLayout>
<Text size="xl" fw={700}> <Text size="xl" fw={700}>
@@ -47,6 +45,8 @@ export const ContinuePage = () => {
); );
} }
const uri = new URL(redirectUri);
if ( if (
window.location.protocol === "https:" && window.location.protocol === "https:" &&
uri.protocol === "http:" uri.protocol === "http:"