From 58184a234c17f6a415f126a37c8aaeab2edffe98 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Thu, 13 Aug 2026 17:41:04 -0700 Subject: [PATCH] feat(auth): AgentID sign-in button on the web login page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Companion to supermemoryai/mono#2908 — the API registers an 'agentid' genericOAuth provider; this adds the matching login button (signIn.oauth2 + genericOAuthClient plugin). Shown on cloud (NEXT_PUBLIC_HOST_ID=supermemory) or when NEXT_PUBLIC_AGENTID_AUTH_ENABLED is set. Co-Authored-By: Claude Fable 5 --- apps/web/.env.example | 3 +- apps/web/app/(auth)/login/page.tsx | 73 ++++++++++++++++++++++++++++++ packages/lib/auth.ts | 2 + 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/apps/web/.env.example b/apps/web/.env.example index aaf5fab4..78da795c 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -1,4 +1,5 @@ NEXT_PUBLIC_BACKEND_URL=https://api.supermemory.ai NEXT_PUBLIC_POSTHOG_KEY= EXA_API_KEY= -XAI_API_KEY= \ No newline at end of file +XAI_API_KEY=# Show the AgentID login button off-cloud (always shown when NEXT_PUBLIC_HOST_ID=supermemory) +NEXT_PUBLIC_AGENTID_AUTH_ENABLED= diff --git a/apps/web/app/(auth)/login/page.tsx b/apps/web/app/(auth)/login/page.tsx index 8500a236..442ded03 100644 --- a/apps/web/app/(auth)/login/page.tsx +++ b/apps/web/app/(auth)/login/page.tsx @@ -591,6 +591,79 @@ export default function LoginPage() { /> ) : null} + {process.env.NEXT_PUBLIC_HOST_ID === "supermemory" || + process.env.NEXT_PUBLIC_AGENTID_AUTH_ENABLED ? ( +
+ + + AgentID + + + + + + + } + authProvider="AgentID" + className="w-full" + disabled={Boolean(loadingMessage)} + onClick={() => { + if (loadingMessage) return + setIsLoading(true) + posthog.capture("login_attempt", { + method: "social", + provider: "agentid", + }) + setPendingLoginMethod("agentid") + signIn + .oauth2({ + callbackURL: getCallbackURL(), + providerId: "agentid", + }) + .catch((err: unknown) => { + setError(getErrorMessage(err)) + setIsLoading(false) + }) + }} + /> +
+ ) : null}