From b1dc5cb4ccee5e2259642778af9de78bcab793f5 Mon Sep 17 00:00:00 2001 From: Stavros Date: Tue, 11 Feb 2025 18:50:33 +0200 Subject: [PATCH] fix: add check to make sure the url can be parsed --- site/src/pages/continue-page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/src/pages/continue-page.tsx b/site/src/pages/continue-page.tsx index ce44cdf2..29df4a12 100644 --- a/site/src/pages/continue-page.tsx +++ b/site/src/pages/continue-page.tsx @@ -31,9 +31,7 @@ export const ContinuePage = () => { }, 500); }; - const uri = new URL(redirectUri); - - if (uri === null) { + if (!URL.canParse(redirectUri)) { return ( @@ -47,6 +45,8 @@ export const ContinuePage = () => { ); } + const uri = new URL(redirectUri); + if ( window.location.protocol === "https:" && uri.protocol === "http:"