From ae27601405dd212b33e87f0c37a64229799cece2 Mon Sep 17 00:00:00 2001 From: Demian Caldelas Date: Fri, 18 Mar 2022 14:56:56 -0300 Subject: [PATCH] Fix double forward slash in auth callback (#2197) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Peer Richelsen Co-authored-by: Omar López --- apps/web/pages/auth/login.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/pages/auth/login.tsx b/apps/web/pages/auth/login.tsx index 0fba7fb9..67247881 100644 --- a/apps/web/pages/auth/login.tsx +++ b/apps/web/pages/auth/login.tsx @@ -59,9 +59,10 @@ export default function Login({ const telemetry = useTelemetry(); - let callbackUrl = typeof router.query?.callbackUrl === "string" ? router.query.callbackUrl : "/"; + let callbackUrl = typeof router.query?.callbackUrl === "string" ? router.query.callbackUrl : ""; // If not absolute URL, make it absolute + if (/"\//.test(callbackUrl)) callbackUrl = callbackUrl.substring(1); if (!/^https?:\/\//.test(callbackUrl)) { callbackUrl = `${WEBSITE_URL}/${callbackUrl}`; }