Repository navigation
docs: add Express and Next.js passwordless auth guides without JWT code - #104
Merged
Merged
Conversation
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.
12 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Codebuild/nextjs-without-jwt.mdx: Add Passwordless Auth To A Next.js App Without Writing JWT CodeEach 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 inllms.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 saysseamless adddoes 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/express0.20.0,@seamless-auth/nextjs0.4.0,@seamless-auth/react0.16.0, Next.js 16.4, Express 5):tsc --noEmitclean; ran with dummy env and no auth server./api/me,/api/profile,/api/adminreturn 401 without a session; a forged cookie returns 401; a correctly signed session cookie returns 200 on/api/meand 403 on/api/admin;/auth/users/mereturns the adapter's 401;/auth/loginreaches the adapter (500internal_errorwith no upstream); CORS preflight returns credentialed allow headers.tscandvite buildclean against react-router-dom 7.tsc --noEmitandnext build(with no env) clean;next startwith dummy env:/api/me401 anonymous and 200 with a signed cookie,/dashboard307 to/loginanonymous and 200 signed in,/login200, all five/authmethods answered by the adapter.seamless-cli@0.22.0 add --local --yesrun against a scratch Express project to confirm its behavior and the values it writes.npm run lint,npm run typecheck,npm run buildpass.Part of fells-code/seamless-auth-api#383