# Updating the user.email\_verified boolean in "real-time"

**URL:** <https://community.auth0.com/t/updating-the-user-email-verified-boolean-in-real-time/117641>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [October 3, 2023, 1:19pm UTC](https://community.auth0.com/t/updating-the-user-email-verified-boolean-in-real-time/117641 "2023-10-03T13:19:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatthewB](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matthewb/32/49456_2.png) [@MatthewB](https://community.auth0.com/u/MatthewB)\
**Post date:** [October 3, 2023, 1:19pm UTC](https://community.auth0.com/t/updating-the-user-email-verified-boolean-in-real-time/117641/1 "2023-10-03T13:19:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 5, 2023, 1:32pm UTC](https://community.auth0.com/t/updating-the-user-email-verified-boolean-in-real-time/117641/3 "2023-10-05T13:32:15Z")

</div>

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:

> [@Force email verification using Actions](https://community.auth0.com/t/force-email-verification-using-actions/76105):
>
> Hi all, I hope you have started this year well. I’m trying to create an Action that forces the user to verify her email before being able to authenticate. In Rules, there is an already defined template that is the following: function emailVerified(user, context, callback) { if (!user.email\_verified) { return callback( new UnauthorizedError('Please verify your email before logging in.') ); } else { return callback(null, user, context); } } What I want to do is basicall…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 19, 2023, 1:32pm UTC](https://community.auth0.com/t/updating-the-user-email-verified-boolean-in-real-time/117641/4 "2023-10-19T13:32:38Z")

</div>

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