From d4c2e0b30e6a8b664ca1fe3206437e49518ff261 Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Mon, 3 Aug 2026 14:22:00 -0400 Subject: [PATCH] feat: respect redirect url in conditional passkey flow --- src/client/login.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/login.ts b/src/client/login.ts index e79b311..c703bec 100644 --- a/src/client/login.ts +++ b/src/client/login.ts @@ -134,8 +134,13 @@ async function initConditionalUI() { await verifyRes.json(); showMessage("Login successful!", "success"); + + // Respect the return URL so auth flows resume after conditional-UI login + const urlParams = new URLSearchParams(window.location.search); + const returnUrl = safeReturnUrl(urlParams.get("return") || "/"); + setTimeout(() => { - window.location.href = "/"; + window.location.href = returnUrl; }, 1000); } catch { // User cancelled or browser doesn't support conditional UI — fall back to manual flow -- 2.51.2