From 573ad989caecc9025cf70bb76221ba003f2b9a05 Mon Sep 17 00:00:00 2001 From: mawkone Date: Fri, 29 May 2026 16:17:18 -0700 Subject: [PATCH] feat(auth): add Copy Workspace Key button on Next.js auth page for desktop SSO fallback --- vibn-frontend/app/auth/page.tsx | 154 +++++++++++++++++++++++++------- 1 file changed, 124 insertions(+), 30 deletions(-) diff --git a/vibn-frontend/app/auth/page.tsx b/vibn-frontend/app/auth/page.tsx index c196d78..033e15b 100644 --- a/vibn-frontend/app/auth/page.tsx +++ b/vibn-frontend/app/auth/page.tsx @@ -22,6 +22,7 @@ function AuthPageInner() { const searchParams = useSearchParams(); const [ssoProcessing, setSsoProcessing] = React.useState(false); + const [ssoToken, setSsoToken] = React.useState(null); useEffect(() => { if (status === "authenticated" && session?.user?.email) { @@ -34,6 +35,7 @@ function AuthPageInner() { .then((r) => r.json()) .then((data) => { if (data.token) { + setSsoToken(data.token); // Deep-link redirect back to the VibnCode desktop app window.location.href = `vibncode://auth/callback?token=${data.token}`; } else { @@ -65,6 +67,8 @@ function AuthPageInner() { }, [status, session, router, searchParams]); if (status === "loading" || ssoProcessing) { + const deepLink = ssoToken ? `vibncode://auth/callback?token=${ssoToken}` : ""; + return (
-
+ {ssoToken ? (
- -
- {ssoProcessing - ? "Authorizing VibnCode Desktop..." - : "Checking session"} +
+ ✓ +
+

+ Authentication Successful +

+

+ Signed in. Redirecting to VibnCode... +

+
+ +

+ If the app doesn't open automatically, copy your Workspace API Key below and paste it into the connection card. +

+
+ +
+
+ {ssoToken} +
-
+ ) : ( +
+
+ +
+ Checking session +
+
+ )}
); }