mirror of
https://github.com/bitbaum/vitareba.git
synced 2026-12-05 15:58:10 +01:00
An unconfigured or failing email provider used to be invisible: forgot-
password answered "sent" with nothing sent (permanent lockout for the
user), cron marked queued emails as delivered, and reset-password errors
surfaced as raw English strings on localized pages. Now:
- lib/email: sendEmail never throws, returns { sent } | { sent, error },
checks the Resend SDK's error return (it doesn't throw); new
isEmailConfigured() gate.
- /api/auth/forgot-password: 503 with a translated "contact us at
{email}" message when the provider is unconfigured — checked before
any user lookup, so no account enumeration.
- /api/auth/reset-password: machine-readable error codes; the page maps
invalid_token to a localized message plus a "request a new link"
recovery action instead of echoing API English.
- cron-emails: unconfigured provider leaves the queue pending (retried
next run); a provider send error marks the row failed instead of sent.
- messages/{de,en,fr,it}: unavailable + expiredError keys.
Verified in-browser at 390px and 1280px: forgot-password honest 503,
reset flow with bad token shows localized error + recovery link.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>