/auth/login, /auth/register and /auth/forgot-password are AccountKit's
forms: password, passkey, an email sign-in link, recovery, Sign in with
OrangeCat and the shared bitbaum sign-in, each when its env is set.
/dashboard/security carries AccountKit's account panel (password,
passkeys, two-step sign-in, linked sign-ins, deletion). compat passes
screens: 'accountkit' (AccountKit 0.20).
AccountKit is the only credential writer. evig's /api/auth/register,
forgot-password, reset-password and verify-email and
/api/user/change-password are removed: they shadowed AccountKit's
endpoints of the same names. Kept, as AccountKit hooks or evig's own code:
the per-account lockout, the 6-digit address code (it replaces
AccountKit's confirmation mail), IT-Hilfe's claim link (now an AccountKit
reset token, old links honoured), the team invitation claim, the HR hire,
staff permissions and referral credit. Deletion is refused for a super
admin and for a person on kept records.
Migration 143 (additive, idempotent) makes the panel's rename and
deletion reach users. The e2e job imports the seeded accounts before the
journeys and runs a browser journey through every method, with mail
caught by a sink.
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9
Co-authored-by: Claude <noreply@anthropic.com>
evig moves from Auth.js to @bitbaum/accountkit one reversible step at a time.
This step adds everything the switch needs and changes nothing while
AUTH_RUNTIME is unset.
- Migration 142: AccountKit's tables under an `auth_` prefix, plus the
users <-> auth_users mirror functions, inert until attached.
- scripts/db/accountkit-import.sql: copies accounts under their own ids,
bcrypt hashes byte for byte, OrangeCat actor ids as `orangecat` rows,
refuses drift or a live shared runtime, then attaches the mirror triggers.
The rehearsal CLI always rolls back and prints only counts.
- src/lib/auth/shared/: the runtime (ids: 'uuid', legacy bcrypt), a session
reader in evig's shape, re-read from `users` on every request, and a
bridge that answers next-auth/react in evig's login codes, keeping
evig's lockout. Proxy and change-password follow the switch.
- src/lib/auth/claims.ts: the staff/verification rule, written once and
used by both runtimes. The jwt callback's three copies now call it.
- CI runs the rehearsal and the real-database journeys after the migration
chain.
docs/ACCOUNTKIT-MIGRATION.md records what is left before switching, chiefly
the unverified-sign-in policy decision.
Claude-Session: https://claude.ai/code/session_019MDtmuvj9Cecd7DR2Nbirb
Co-authored-by: Claude <noreply@anthropic.com>