Updating the user.email_verified boolean in "real-time"

Situation:
I have an Ionic React App with the auth0/auth0-react package installed. I am using the useAuth0 hook to authenticate users with no problem. Currently, validation is setup to check whether or not a user has verified their email. A “Verify your email before proceeding” page is shown. Is there a way to track the user.email_verified boolean from the useAuth0 hook in “real-time”? Meaning, as soon as a user clicks on the “Verify Account” button sent to their email, the user object picks up the change.

Thank you in advance.

1 Like

Hi @MatthewB,

Welcome to the Auth0 Community!

You will need to poll the userinfo endpoint or get a new token to tell if the user has verified their email using this approch.

A typical approach with Auth0 would be to handle this in an action (check for email_verified) and return an error if not. If your app is returned the error, tell the user to verify their email and then have a button to reauthenticate.

Here’s an example:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.