Hi everyone.
Environment
Next js
Issue
- User Signs up
- User lands inside website on ‘/unverified’ page
- We ask them to verify you email first before proceeding
- At the same time, Auth0 automatically sends the Verification Email.
- User open their email and clicks on the verification link
- Link open up and url turns to something like this:
-
message=Your%20email%20was%20verified.%20You%20can%20continue%20using%20the%20application.&success=true&code=success)
- After verification we land back on website
- 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
returnsundefined
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!