mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 12:45:47 +00:00
refactor: use try catch instead of can parse
This commit is contained in:
@@ -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:"
|
||||||
|
|||||||
Reference in New Issue
Block a user