Merged
Conversation
- Thread config.domain through the call chain as an explicit parameter
on both handleEmailLogin() and sendLoginEmail(), matching the pattern
used by the email tool in src/index.ts (config.domain ?? "ghostwright.dev")
- Remove direct process.env.PHANTOM_DOMAIN read from sendLoginEmail so
domain set via phantom.yaml is respected, not just the env var
- Destructure { error } from resend.emails.send() and throw on API errors;
the SDK returns errors in the response rather than throwing, so the
previous code silently logged success on send failures
- Add domain?: string to handleFirstRun config type to accept the field
…_EMAIL - Add test: sendLoginEmail throws when Resend returns an API error response - Add test: domain parameter is used for the sender domain (not env var) - Update all call sites in tests to pass domain as explicit 4th argument - Document OWNER_EMAIL in .env.example Email section
mcheemaa
approved these changes
Apr 17, 2026
Member
mcheemaa
left a comment
There was a problem hiding this comment.
Clean fix, tight tests, nice catch on the Resend error response too. Thanks for the thorough write-up in the PR body. Approving. Looking forward to more from you.
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.
What Changed
Fixes the sender domain for email login that leads to resend rejecting the email when using a custom
PHANTOM_DOMAINWhy
When using a custom
PHANTOM_DOMAINI am unable to receive an email because it is rejected by Resend.Expected Result:
When providing my email to the Phantom login, I receive an email with the magic link
Actual Result:
No email arrives. Resend logs show the these as
403errors with the messageDomain not verified: Verify ghostwright.dev or update your from domain.The sender is not using my configuredPHANTOM_DOMAIN"from": "Phantom <phantom@ghostwright.dev>"How I Tested
Ran the branch on my VM and received the email as expected.
Checklist
bun test)bun run lint)bun run typecheck).envfiles included