diff --git a/connect/src/app/(handoff)/connect/_components/connect-page-ui.tsx b/connect/src/app/(handoff)/connect/_components/connect-page-ui.tsx index 47eb876c..0a9f83d9 100644 --- a/connect/src/app/(handoff)/connect/_components/connect-page-ui.tsx +++ b/connect/src/app/(handoff)/connect/_components/connect-page-ui.tsx @@ -8,7 +8,7 @@ import { XIcon, } from "lucide-react"; import Link from "next/link"; -import { type ReactNode, useState } from "react"; +import { type ReactNode, useEffect, useState } from "react"; import { APP_ROUTES } from "@/app/routes"; import { Spinner } from "@/components/elements/spinner"; import { DcIcon } from "@/components/icons/dc-icon2"; @@ -140,6 +140,34 @@ export function ConnectReadyState({ deepLinkUrl: string; downloadDataConnectHref: string; }) { + const isHttpsRedirect = deepLinkUrl.startsWith("https://"); + + // Auto-redirect for OAuth HTTPS callbacks (e.g., MCP auth flow) + useEffect(() => { + if (isHttpsRedirect) { + window.location.assign(deepLinkUrl); + } + }, [isHttpsRedirect, deepLinkUrl]); + + if (isHttpsRedirect) { + return ( + + + Authorizing... + + } + subtitle={ + + Redirecting back to your application. + + } + /> + ); + } + return ( , ): URLSearchParams { const params = new URLSearchParams(); @@ -408,5 +427,11 @@ function createHandoffQueryParams( if (context.appName) { params.set("appName", context.appName); } + if (context.redirectUri) { + params.set("redirect_uri", context.redirectUri); + } + if (context.oauthState) { + params.set("oauth_state", context.oauthState); + } return params; }