feat: resend verification email on sign-in and improve template#4239
Merged
Siumauricio merged 2 commits intocanaryfrom Apr 17, 2026
Merged
feat: resend verification email on sign-in and improve template#4239Siumauricio merged 2 commits intocanaryfrom
Siumauricio merged 2 commits intocanaryfrom
Conversation
- Add `sendOnSignIn: true` to emailVerification config so unverified users receive a new verification email when they attempt to sign in - Create styled verification email template matching the invoice email design - Extract `sendVerificationEmail` helper to keep auth.ts clean - Show friendly message on login when email is not verified
Change the logger's disabled property to be dependent on the NODE_ENV variable, ensuring logging is disabled in production for improved performance and security.
Comment on lines
+88
to
+93
| if (isEmailNotVerified) { | ||
| const msg = | ||
| "Your email is not verified. We've sent a new verification link to your email."; | ||
| toast.info(msg); | ||
| setError(msg); | ||
| return; |
Contributor
There was a problem hiding this comment.
Informational message displayed in error-styled block
setError(msg) feeds into <AlertBlock type="error"> (rendered in red at line 243), while toast.info correctly uses a neutral tone. The message "We've sent a new verification link to your email" is good news, not an error — showing it in a red alert is confusing. Consider introducing separate state (e.g. setInfoMessage) rendered with a neutral AlertBlock type="info", or avoid calling setError here entirely since the toast already communicates the status.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
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
sendOnSignIn: truetoemailVerificationconfig — unverified users now receive a new verification email when they attempt to sign insendVerificationEmailhelper function tosend-verification-email.tsxEMAIL_NOT_VERIFIEDerror and shows a friendly message instead of the raw errorGreptile Summary
This PR adds
sendOnSignIn: trueto the email verification config so unverified users receive a new verification link on sign-in, introduces a styled React Email verification template matching Dokploy's branding, and shows a friendly frontend message instead of the raw auth error.logger.disabledwas changed fromprocess.env.NODE_ENV === "production"tofalse, unconditionally enabling auth logs in production and potentially exposing session/token data in server logs.Confidence Score: 4/5
Safe to merge after reverting the logger change; all other changes are well-scoped and correct.
One P1 issue remains: the auth logger was unintentionally set to always-on (
disabled: false), which enables verbose auth logs in production and should be reverted before merging. All other changes — the email template, thesendVerificationEmailhelper, and the frontend error handling — are correct and well-implemented.packages/server/src/lib/auth.ts — logger configuration regression at line 79.
Comments Outside Diff (1)
packages/server/src/lib/auth.ts, line 79 (link)Setting
disabled: falseunconditionally re-enables the auth library logger in production, reverting the previous intentional guard (process.env.NODE_ENV === "production"). Better-auth's logger can emit session tokens, user IDs, and request details — having it always on in production creates unnecessary log noise and risks leaking sensitive auth data.Reviews (1): Last reviewed commit: "fix: update logger configuration to disa..." | Re-trigger Greptile