supermemory/apps/web
Dhravya 5d2b5855fe
feat(auth): AgentID sign-in button on the web login page (#1467)
## What?

Adds a "Continue with AgentID" button to the web app's login page, matching the existing Google/GitHub buttons (same `ExternalAuthButton` pattern, PostHog `login_attempt` capture, last-used badge).

- `packages/lib/auth.ts`: adds the `genericOAuthClient` plugin — generic OAuth providers sign in via `signIn.oauth2({ providerId })`, not `signIn.social`.
- `apps/web/app/(auth)/login/page.tsx`: the button, gated the same way as the other social buttons — always shown on cloud (`NEXT_PUBLIC_HOST_ID === "supermemory"`), opt-in elsewhere via `NEXT_PUBLIC_AGENTID_AUTH_ENABLED` (added to `.env.example`).

## Why?

Companion to supermemoryai/mono#2908, which registers an `agentid` generic OAuth provider (OIDC against auth.agentid.com) on the API so agents can authenticate with their AgentID identity. The consumer app talks to the same better-auth server, so it gets the same sign-in option. mono#2916 additionally auto-invites the agent's verified human owner to the agent's workspace.

Requires mono#2908 to be deployed for the button to work; until then the API rejects the unknown provider and the page shows its normal error state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches authentication entry points and OAuth client configuration; risk is moderate because it extends login surface area but follows existing social sign-in patterns and is feature-flagged.
>
> **Overview**
> Adds **Continue with AgentID** on the web login page, using the same `ExternalAuthButton` flow as Google/GitHub (PostHog `login_attempt`, last-used badge, loading/error handling).
>
> The button calls **`signIn.oauth2({ providerId: "agentid" })`** instead of `signIn.social`, enabled by registering **`genericOAuthClient`** on the shared better-auth client in `packages/lib/auth.ts`.
>
> Visibility matches other social providers: shown on cloud when `NEXT_PUBLIC_HOST_ID === "supermemory"`, or elsewhere when **`NEXT_PUBLIC_AGENTID_AUTH_ENABLED`** is set (documented in `.env.example`). Depends on the API registering the `agentid` generic OAuth provider.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 90a32786a3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-08-16 23:20:38 +00:00
..
app feat(auth): AgentID sign-in button on the web login page (#1467) 2026-08-16 23:20:38 +00:00
components feat(web): support discount code checkout (#1523) 2026-08-16 13:43:53 -07:00
hooks feat(web): support discount code checkout (#1523) 2026-08-16 13:43:53 -07:00
lib Upgrade Nova model picker to current runtime models (#1404) 2026-08-13 17:08:50 +05:30
public add weekly digests, log, and opt out options (#1107) 2026-06-18 01:06:40 +00:00
stores feat(web): company brain entitlement helper, hook + ?org deep-link activation (#1110) 2026-06-22 17:54:13 +00:00
.env.example feat(auth): AgentID sign-in button on the web login page (#1467) 2026-08-16 23:20:38 +00:00
.gitignore sentry sourcemaps 2025-08-23 09:55:40 -07:00
biome.json feat: mobile responsive, lint formats, toast, render issue fix (#688) 2026-01-21 03:11:53 +00:00
components.json New Version of Supermemory Consumer App 2025-08-16 18:50:10 -07:00
globals.css Render Nova connector setup cards (#1071) 2026-07-28 15:58:50 +00:00
instrumentation-client.ts feat: warning when model is unavailable in the region (#814) 2026-03-28 05:52:41 +00:00
middleware.ts MCP Revamp (#1120) (#1380) 2026-07-30 17:08:51 -07:00
next.config.ts Rewrite @supermemory/memory-graph with perf optimizations + consolidate consumers (#809) 2026-03-28 19:06:27 -07:00
open-next.config.ts feat: mobile responsive, lint formats, toast, render issue fix (#688) 2026-01-21 03:11:53 +00:00
package.json fix: add type checks for TypeScript workspaces (#1447) 2026-08-13 17:55:50 +05:30
postcss.config.mjs feat: mobile responsive, lint formats, toast, render issue fix (#688) 2026-01-21 03:11:53 +00:00
README.md New Version of Supermemory Consumer App 2025-08-16 18:50:10 -07:00
tsconfig.json fix 2026-02-09 22:07:09 -08:00
wrangler.jsonc feat: mobile responsive, lint formats, toast, render issue fix (#688) 2026-01-21 03:11:53 +00:00

supermemory Consumer