Skip to content

docs: add Express and Next.js passwordless auth guides without JWT code - #104

Merged
Bccorb merged 2 commits into
mainfrom
docs/express-nextjs-without-jwt
Oct 13, 2026
Merged

Bccorb merged 2 commits into
mainfrom
docs/express-nextjs-without-jwt

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

Two task-shaped pages for a developer or coding agent about to hand-roll JWT auth, modeled on the Python, Go, and Rust adapter pages:

  • build/express-without-jwt.mdx: Add Passwordless Auth To An Express API Without Writing JWT Code
  • build/nextjs-without-jwt.mdx: Add Passwordless Auth To A Next.js App Without Writing JWT Code

Each has a short why-not-hand-roll paragraph, the no-prompt scaffold (npx seamless-cli init my-app --local --yes --email=you@example.com, plus --nextjs), an existing-app path (install, complete server code, frontend, env vars), a "what not to write yourself" list, and links to the reference pages. Sidebar order 1.1 and 1.2 puts them right after the Build overview, and both appear in llms.txt.

The Express page also points to seamless add --local, which shipped in seamless-cli 0.22.0 and is not documented elsewhere yet. The Next.js page says seamless add does not support Next.js (checked: it reports "Also found Next.js, which seamless add does not wire yet").

Verified by execution

Every code block on both pages is byte-identical to a file that was compiled and run against the published packages (@seamless-auth/express 0.20.0, @seamless-auth/nextjs 0.4.0, @seamless-auth/react 0.16.0, Next.js 16.4, Express 5):

  • Express: tsc --noEmit clean; ran with dummy env and no auth server. /api/me, /api/profile, /api/admin return 401 without a session; a forged cookie returns 401; a correctly signed session cookie returns 200 on /api/me and 403 on /api/admin; /auth/users/me returns the adapter's 401; /auth/login reaches the adapter (500 internal_error with no upstream); CORS preflight returns credentialed allow headers.
  • React frontend for the Express page: tsc and vite build clean against react-router-dom 7.
  • Next.js: tsc --noEmit and next build (with no env) clean; next start with dummy env: /api/me 401 anonymous and 200 with a signed cookie, /dashboard 307 to /login anonymous and 200 signed in, /login 200, all five /auth methods answered by the adapter.
  • seamless-cli@0.22.0 add --local --yes run against a scratch Express project to confirm its behavior and the values it writes.
  • npm run lint, npm run typecheck, npm run build pass.

Part of fells-code/seamless-auth-api#383

Task-shaped pages for agents and developers about to hand-roll JWT auth:
one install, the mount line, a protected route, the sign-in UI, and env
vars, with code that was typechecked and run against the published
@seamless-auth/express 0.20.0, @seamless-auth/nextjs 0.4.0, and
@seamless-auth/react 0.16.0.
@Bccorb
Bccorb merged commit 7170a29 into main Oct 13, 2026
3 checks passed
@Bccorb
Bccorb deleted the docs/express-nextjs-without-jwt branch October 13, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant