Identity: accounts, sign-in and sessions through better-auth #10
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/identity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on #9.
Backend (Identity context, wrapper over better-auth 1.7.10):
AUTH_LOCAL_SIGNUP=closedturns self sign-up off.AUTH_OIDC_PROVIDERS(better-auth's generic OAuth plugin with discovery and PKCE), for Pocket ID. Configured, not yet tried against a real provider.urn:habitea:identity:user:<ULID>. No other context changed.identityschema. Our migrate step runs better-auth's own migration planner; it reports what it applied and refuses unsafe changes.SessionActorResolverturns the session cookie into anActorfor the existingActorGuard.AUTH_MODE=devalso accepts thex-dev-user-idheader for scripts; production refuses it (now the default issession).GET /api/identity/sign-in-optionstells the app which providers to show and whether sign-up is open./api/auth/*before the JSON body parser. Telemetry is off.AUTH_SECRET,AUTH_BASE_URL,AUTH_LOCAL_SIGNUP,AUTH_OIDC_PROVIDERS, documented in.env.example.Web:
identity.invalid_credentials, ...) in the HTTP adapter, so nothing past it knows the library.config.jsonnow defaults toauthMode: session.Checked:
A dev-only demo account is recorded in
tools/dev/demo-accounts.json.Not yet: passkeys (they need HTTPS), invites, email verification and password reset (they need email),
UserRegisteredV1andUserDeletedV1, account deletion.🤖 Generated with Claude Code