Files
CatoandClaude 0244bdf946 feat(auth): email recovery once mail is set, a way back while it is not (#337)
Solon's accounts already wire @bitbaum/accountkit's mailer (mail-kit,
Resend), but production has no mail env, so password accounts have no
recovery and the sign-in screen is a dead end for a lost password.

- The mailer moves to src/lib/auth/mail.ts so both states can be tested
  without a request. Forgot password, the reset link and sign-in by link
  stay hidden until RESEND_API_KEY holds a usable key, as before.
- While mail is off, the sign-in screen says so and names the ways back
  that exist here: a passkey, OrangeCat when it is switched on, and the
  contact address. Five languages, no concatenated sentences.
- .env.example documents RESEND_API_KEY, RESEND_FROM and
  NEXT_PUBLIC_SITE_URL, with no values.
- Unit tests cover both states, the fleet sender, the reset subject and
  the refusal to mail a link to another origin. A Playwright spec checks
  the no-mail state in CI's render job; the configured state stays with
  the shared account journey.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 05:26:19 +01:00
..
2026-08-31 08:15:49 +00:00