Update The Email Verification Status Without Reloading Page
After registering in my web app, i redirect the user to a page, where he is told to verify his email. Once he has done that, i want to automatically detect the change of the verificationStatus and then change the page. Something along those lines.
auth.user.subscribe(user => {
if (!!user && user.emailVerified === true) {
this.redirectToLogin();
}
});
I couldn't find any way to detect changes of the emailVerified status, so I thought, maybe have an interval runnning that is updating the user data every now and then, but I couldn't find a way how to refresh the user data from firebase authentication.
Is there a way to update the user data without reloading/refreshing the page? Do i have to refresh the authState? If possible, how can i do that?
Is what I want to do, even possible?
Answer
The change in email verification status happens on the Firebase servers. It is not automatically pushed to the client.
On the client you can reload the user data to pick up any changes, by calling User.reload()
.
Also see:
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM