Repository navigation
Replace auth and admin with a Better Auth extension (#841) - #854
Merged
Merged
Conversation
…xtension (#841) @jimhoyd/urlcode-auth is now a thin adapter over Better Auth: one mount forwarding an exact allowlist of Better Auth paths, `auth: true` route protection that sets the verified user id as the request principal, and the request-bound `identity` capability. Accounts, sessions, password hashing and rate limiting are Better Auth's; the operator CLI is `urlcode-auth migrate` and `create-user`, and credentials stay in operator configuration. Deleted: the home-grown account system in packages/auth, packages/admin, the authenticated-handlers, headless-auth-profile and fixed-contract-adapter recipes, COMPOSING-A-SITE and AUTH-BACKUP. The #843 proof now runs on the first-party extension instead of its own adapter package. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 28, 2026 18:22
This was referenced Sep 28, 2026
Closed
…ndows EBUSY) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Sep 28, 2026
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.
Part of #841, following the #843 proof. Chosen option: retire now, minimal.
What changes
@jimhoyd/urlcode-authis a thin Better Auth 1.7.6 adapter (packages/auth/src/auth.ts):/api/auth/*,extension: auth) and forwards only an exact allowlist of Better Auth paths. Everything else under the mount returns 404.auth: trueon a route requires a verified Better Auth session, refuses cross-origin unsafe methods, and sets the user id as the request principal.context.capabilities.auth.identity.userIdand never sees the Cookie or Authorization header.data/auth.secretorBETTER_AUTH_SECRET, anddata/auth.sqlite.urlcode-auth migrateandurlcode-auth create-user. Activation refuses until the tables exist, because a migration is an explicit operator step.Deleted:
packages/auth, and all ofpackages/adminauthenticated-handlers,headless-auth-profileandfixed-contract-adapterdocs/COMPOSING-A-SITE.mdanddocs/AUTH-BACKUP.mdNo compatibility layer, per the no-external-users decision. Roles and permissions are application data keyed by the user id; the proof shows a reviewer check done that way.
store, form-records and forms now use
auth: true. The audit outbox cap is per store collection; auth no longer writes audit events.The [Request]: Prove an embedded upstream auth provider in one local URLCode application #843 proof (
proofs/private-requests) now runs on the first-party extension, and its own adapter package is deleted. The independent-package demo stays intest/fixtures/addons/greeting.Docs, llms, skills, the starter and the generated references are rewritten or regenerated to match.
Evidence (macOS, Node 26)
npm run verify: passes. It includestest:proof, 12/12: owner privacy, reviewer approval with a concurrent race, cross-origin refusal, revoked-cookie replay, spoofed-header throttling, sandbox refusal, andaudit --expect-routes 8ready.npm test: 1099 passed, 0 failed.npm run test:addons: 5/5. Every extension installs, composes and serves, then signs in through Better Auth and writes as the signed-in user.npm run test:package: passes.Limits
Follow-ups
passkeyRpIdseam (next PR).🤖 Generated with Claude Code