Compare commits

...

1 Commits

Author SHA1 Message Date
Stavros
6f35923735 refactor: use try catch instead of can parse 2025-02-12 18:43:35 +02:00

View File

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