Repository navigation
Conversation
… and surface send failures Self-hosts without RESEND_FROM_DOMAIN sent from auth@undefined, which Resend rejects, while the UI still said a code was sent. Email is now treated as configured only when the API key and sender are both available, login codes are logged otherwise, the verify screen says email is not configured, explicit fromOverride senders keep working without a default domain, and invite APIs report not_configured instead of accepted.
|
@07rjain is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| {emailDeliveryConfigured ? ( | ||
| <p className="text-sm text-gray-10"> | ||
| We sent a 6-digit code to {normalizedEmail} | ||
| </p> | ||
| ) : ( | ||
| <p className="text-sm text-gray-10"> | ||
| Email (Resend) is not configured on this server. The 6-digit code | ||
| for {normalizedEmail} was printed to the server logs. Ask your | ||
| administrator, or set RESEND_API_KEY and RESEND_FROM_DOMAIN. |
There was a problem hiding this comment.
Resend still promises an email
The new emailDeliveryConfigured flag fixes the page text, but the resend toast still says “A new code has been sent to your email!” when email is disabled. Requesting another code only prints it to the server logs. Use the flag in handleResend.onSuccess too, so users are not sent back to their inbox.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/app/(org)/verify-otp/form.tsx
Line: 176-184
Comment:
**Resend still promises an email**
The new `emailDeliveryConfigured` flag fixes the page text, but the resend toast still says “A new code has been sent to your email!” when email is disabled. Requesting another code only prints it to the server logs. Use the flag in `handleResend.onSuccess` too, so users are not sent back to their inbox.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| const error = result.value?.error; | ||
| return Boolean(error && error.name !== "email_not_configured"); |
There was a problem hiding this comment.
Excluding email_not_configured from failedInvites keeps the invite links usable, but it also leaves failedEmails empty. InviteDialog then shows “Invites sent successfully” without warning that no email was sent. Return a separate delivery status and show the skipped-email notice without deleting the invite records.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/actions/organization/send-invites.ts
Line: 190-191
Comment:
**Skipped invites look sent**
Excluding `email_not_configured` from `failedInvites` keeps the invite links usable, but it also leaves `failedEmails` empty. `InviteDialog` then shows “Invites sent successfully” without warning that no email was sent. Return a separate delivery status and show the skipped-email notice without deleting the invite records.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Split out of #2580 (email delivery status).
RESEND_API_KEYbut noRESEND_FROM_DOMAINsent fromauth@undefined. Resend rejects that, but the UI still said a code was sent.getEmailDeliveryStatus()/sendEmail()now returnemail_not_configuredwhen no usable sender exists. An explicitfromOverridestill works without a default domain.emailDelivery: "not_configured"instead ofaccepted.AgentOrganizationInviteResponsegains that literal.Tests.
email-config.test.ts.The PR appears safe to merge, with two non-blocking messages that still claim skipped emails were sent.
Findings
Fix with agent prompt
Summary
The PR stops self-hosted email from using
auth@undefinedand reports missing email settings.07rjainexplicitly intends login codes to appear in server logs when email is not configured.Reviews (1) · Last reviewed commit: "fix(email): never send from auth@undefin..." · Reviewed by Greptile