Files
heidi/scripts/audit
CatoandClaude 1517340bfd feat(auth): prove email recovery in both mail states (#252)
Heidi already had AccountKit's shared mailer wired, but nothing held what
it should do, and the env that turns it on was undocumented, so it never
got set and live sign-in offers no way back from a forgotten password.

- lib/auth/mail.ts: Heidi's account mailer (createAuthMailer over
  @bitbaum/mail-kit) as one factory, so tests exercise the real adapter.
- lib/auth/recovery.test.ts: with no mail env (or a placeholder key, or a
  sandbox sender) no reset, link or address check is offered and a reset
  request sends nothing; with it, a reset email goes to Heidi's origin and
  its link sets a new password once.
- scripts/audit/account-recovery.mjs, run by the shared account journey:
  in a real browser, "Forgot your password?" and the sign-in link are shown
  in de, fr and ru at 320 and 390px and the forgot form ends in its notice;
  the same build started without mail env shows neither.
- .env.example: BETTER_AUTH_SECRET, RESEND_API_KEY, RESEND_FROM.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-30 18:12:25 +01:00
..