Default Email Verification email does not verify user

Hi everyone.

Environment
Next js

Issue

  1. User Signs up
  2. User lands inside website on ‘/unverified’ page
  3. We ask them to verify you email first before proceeding
  4. At the same time, Auth0 automatically sends the Verification Email.
  5. User open their email and clicks on the verification link
  6. Link open up and url turns to something like this:
  7. message=Your%20email%20was%20verified.%20You%20can%20continue%20using%20the%20application.&success=true&code=success)

  8. After verification we land back on website
  9. However, user still does not get verified
  • To check whether user is verified or not we are doing this:
import { useUser } from "@auth0/nextjs-auth0";
  const auth0User = useUser();
  if (auth0User.user?.email_verified){ 
// User verified
}
  • We also get success logs in Monitoring → Logs i.e.

“description”: “Your email was verified. You can continue using the application.”,

  • Moreover, in User Management → Users,
  • The User email status remains Pending
  • However, auth0User.user?.email_verified returns undefined so we cannot proceed further
  • It is not even false…

Twist In The Story
We have a button to resend email
If user clicks on it we send an email through management API
That email works perfectly and verifies the account
auth0User.user?.email_verified returns true and user can use the app

Conclusion

  • Default email sent by Auth0 does not verify account although the logs say otherwise ?
    When we manually resend the email it works fine and verifies the account.
    However, apparently there is not difference in the generated verification links

  • We can toggle enable/disable email templates
    If we disable, we do not get default email but then we also cannot send an email by management api as well

In short, fist default email does not work. User has to resend email and then everything works smoothly…

Waiting for an answer.
Thanks in advance!

3 Likes