From 8de01a49d38194b567d78fc4f5ebb5eea119b5d5 Mon Sep 17 00:00:00 2001 From: Prasanna721 <106952318+Prasanna721@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:31:35 +0000 Subject: [PATCH] fix oauth resume redirect (#1122) Fix the Claude Desktop MCP OAuth resume path after login/org selection. - drop stale signed Better Auth params before resuming \`/oauth2/authorize\` - consume \`prompt=login\` so approve can continue to consent/code redirect instead of looping back to login Tested with \`bunx biome check apps/web/app/'(auth)'/login/page.tsx\`. --- apps/web/app/(auth)/login/page.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/web/app/(auth)/login/page.tsx b/apps/web/app/(auth)/login/page.tsx index e994d133..c7723724 100644 --- a/apps/web/app/(auth)/login/page.tsx +++ b/apps/web/app/(auth)/login/page.tsx @@ -33,6 +33,19 @@ function buildMcpAuthorizeResumeUrl( const p = new URLSearchParams(sp.toString()) p.delete("redirect") p.delete("error") + p.delete("exp") + p.delete("sig") + + const prompt = p + .get("prompt") + ?.split(" ") + .filter((value) => value && value !== "login") + if (prompt?.length) { + p.set("prompt", prompt.join(" ")) + } else { + p.delete("prompt") + } + return `${backend}/api/auth/oauth2/authorize?${p.toString()}` }