Files
loki/scripts/test
CatoandClaude 929e22a423 feat(auth): passkeys, the second factor and the sign-in link on Loki's AccountKit runtime (#1539)
Since the switch to AccountKit, Loki offered OrangeCat, email + password and
its own recovery. The runtime serves passkeys, the second factor and the
sign-in link, but the compat layer answered 404 for all of them, and Loki's
screens had no way to use them.

- src/lib/auth/shared/open-paths.ts lists the AccountKit endpoints Loki's
  screens reach directly: passkeys, the second factor and the sign-in link.
  src/auth.ts routes them past the compat layer. None of them writes a
  password. Sign-up, reset, password, profile and deletion stay closed, so
  Loki's users table remains the one credential writer.
- The sign-in card, on this runtime, adds "Sign in with a passkey", "Email me
  a sign-in link instead" (with account mail), and the code step after a
  password when the account has the second factor. The password goes straight
  to AccountKit for that; the demo still uses compat. Sign-up offers the
  link too. The words are AccountKit's labels.
- Settings → Account adds passkeys (add, remove) and the second factor (set
  up with the password, confirm with the first code, backup codes, turn off).
- A runtime plugin (sign-in-hook.ts) runs after every new session, whatever
  the way in. It gives a person AccountKit has but Loki does not (a link to a
  new address) their users row, then runs bootstrapAfterSignIn. The compat
  layer no longer runs it a second time.
- accountkit-journeys (test:db) adds three cases: the second factor (a
  password alone gets the code step, the TOTP code makes the session), the
  hook making the Loki row and workspace, and which paths are open.
- The migration doc says what is open and why.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 23:00:54 +01:00
..
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00