Email Verification Email is not Sent
I've been trying to add emailVerification to my app for some time, but didn't get it working. My function works well, doesn't have issues when trying it externally from better auth. But when I am trying to make it send the email, it does not work. ( Added prints and it looks like the function isn't called )
If anyone could help me I'll be very grateful
Solution:Jump to solution
It looks like the verification email isn’t being sent because the configuration is misplaced. According to Better Auth’s documentation, options like sendOnSignUp and sendVerificationEmail should be defined under the emailVerification configuration rather than inside emailAndPassword. In your snippet, they’re currently under emailAndPassword, so the framework isn’t triggering the verification email on signUp [1], [4].
To fix this, move these options to the emailVerification object in your auth configuration. This should ensure that the email verification process is correctly triggered on signUp.
Sources:...
Email | Better Auth
Learn how to use email with Better Auth.
Email & Password | Better Auth
Implementing email and password authentication with Better Auth.
1 Reply
Solution
It looks like the verification email isn’t being sent because the configuration is misplaced. According to Better Auth’s documentation, options like sendOnSignUp and sendVerificationEmail should be defined under the emailVerification configuration rather than inside emailAndPassword. In your snippet, they’re currently under emailAndPassword, so the framework isn’t triggering the verification email on signUp [1], [4].
To fix this, move these options to the emailVerification object in your auth configuration. This should ensure that the email verification process is correctly triggered on signUp.
Sources:
[1] Email | Better Auth
[4] Email & Password | Better Auth
Email | Better Auth
Learn how to use email with Better Auth.
Email & Password | Better Auth
Implementing email and password authentication with Better Auth.