Skip to content

Scheduling infrastructure for absolutely everyone.

Fix double forward slash in auth callback (#2197)

Demian Caldelasae27601405dd
diff --git a/apps/web/pages/auth/login.tsx b/apps/web/pages/auth/login.tsx
index 0fba7fb9fed..6724788103f 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}`;
}