Skip to content

fix: surface email sending errors during login#263

Merged
elsbrock merged 2 commits intomainfrom
fix/login-email-error-handling
Mar 24, 2026
Merged

fix: surface email sending errors during login#263
elsbrock merged 2 commits intomainfrom
fix/login-email-error-handling

Conversation

@elsbrock
Copy link
Copy Markdown
Owner

Summary

  • Fix silent email failures that caused login to appear successful even when no verification email was sent (fixes no login possible #262)
  • sendMail() now throws when FORWARDEMAIL_API_KEY is missing (prod) or when the API call fails
  • The identify action catches mail errors and returns a user-visible error message
  • Remove duplicate db null check

Root cause

sendMail() silently returned on missing API key and silently logged on API failure. The login action returned { success: true } regardless, so users advanced to the code entry step without ever receiving an email.

Test plan

  • Verify npm run check passes (0 errors, 0 warnings)
  • Verify npm run test passes (33 tests)
  • Verify that when FORWARDEMAIL_API_KEY is not set in production, users see "Unable to send verification email" instead of being silently advanced to code entry
  • Verify normal login flow still works when API key is configured

https://claude.ai/code/session_01NcFMkkLkJhhhTmuP7L2bLT

@elsbrock elsbrock mentioned this pull request Mar 24, 2026
claude added 2 commits March 24, 2026 06:25
When the FORWARDEMAIL_API_KEY is missing or the email API call fails,
sendMail() previously failed silently, causing the login flow to report
success even though no verification email was sent (fixes #262).

Changes:
- sendMail() now throws on missing API key (prod) and failed API calls
- identify action catches mail errors and returns a user-visible message
- Remove duplicate db null check
@elsbrock elsbrock force-pushed the fix/login-email-error-handling branch from 4d7e147 to 48d1ee6 Compare March 24, 2026 06:27
@elsbrock elsbrock merged commit fc6e413 into main Mar 24, 2026
0 of 4 checks passed
@elsbrock elsbrock deleted the fix/login-email-error-handling branch March 24, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no login possible

2 participants