fix: surface email sending errors during login#263
Merged
Conversation
Closed
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
4d7e147 to
48d1ee6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sendMail()now throws whenFORWARDEMAIL_API_KEYis missing (prod) or when the API call failsidentifyaction catches mail errors and returns a user-visible error messagedbnull checkRoot 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
npm run checkpasses (0 errors, 0 warnings)npm run testpasses (33 tests)FORWARDEMAIL_API_KEYis not set in production, users see "Unable to send verification email" instead of being silently advanced to code entryhttps://claude.ai/code/session_01NcFMkkLkJhhhTmuP7L2bLT