How to Prevent Automatic Resending of Verification Email on Login with requireEmailVerification?
I have a question regarding the
requireEmailVerification
option.
When I set requireEmailVerification: true
, the backend correctly returns a 403 response if a non-verified user tries to log in. I handle this on the frontend by showing a verification modal. However, I’ve noticed that BetterAuth also automatically resends the verification email to the user when this happens.
What I want:
I want the verification email to be sent only when the user explicitly requests it (for example, by clicking a "Resend Verification Email" button in the modal), not automatically when they attempt to log in.
Is there a way to disable this automatic resending of the verification email when a non-verified user tries to log in, while still using requireEmailVerification: true
? Or do I need to implement custom logic to handle this scenario?
Here’s my current configuration:
And here is my login handler:
Is there a configuration option to prevent the automatic sending of the verification email on login, or do I need to implement custom logic to handle this scenario?0 Replies