Fix misleading 'check your email' message when EMAIL_METHOD is dev#1692
Conversation
When EMAIL_METHOD is "dev" (the default), verification emails are only logged to the console and never actually sent. Update the UI messages to note that users should check the server logs in dev mode, and fix the backend console message that incorrectly said the email was sent.
| if (result.info?.detail === 'LOGIN_USER_NOT_VERIFIED') { | ||
| setError( | ||
| 'Email not verified. Please check your email for the verification link.', | ||
| 'Email not verified. Please check your email for the verification link. If running in dev mode, check the server logs instead.', |
There was a problem hiding this comment.
Not sure if this is a good idea but just wanting to ideate whether you think adding a metadata field to healthz and then checking what mode EMAIL_METHOD is set to through that and then showing the appropriate message would be overkill?
The intent is that we dont show dev-related stuff when things are running in production. Please let me know if you think this is overkill?
There was a problem hiding this comment.
Good idea, not an overkill! I was trying to keep things as simple as possible but missed the prod angle.
I've updated the PR — added email_method to the /healthz response and made the frontend messages conditional based on that. Now the dev mode note only shows when EMAIL_METHOD is actually "dev".
Let me know if you think further changes are required.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Add email_method to /healthz response so the frontend can check it. Show "check the terminal" message only when EMAIL_METHOD is dev, and "check your email" when SMTP is configured.
Summary
Fixes #1682
When
EMAIL_METHODis"dev"(the default), verification emails are only logged to the console — never actually sent. But the UI says "check your email" and the console prints✅ Verification email sent, which misleads users into waiting for an email that never arrives.📋 Verification link logged to console above (as you're in dev mode)instead of the incorrect✅ Verification email sentwhen in dev mode