0

I want to check if a user confirmed his email on another device, i.e. opened the email.

My hacky way is to check with setInterval every 2secs and check auth.currentUser.emailVerified Is there any way to subscribe to auth updates? like confirming email, adding a phone, or changing his displayName?

Shrod1987
  • 1
  • 1

1 Answers1

0

Is there any way to subscribe to auth updates?

If the user is signed in on the device, it already receives the latest user profile every hour (when the ID token refreshes). Aside from these automatic updates there is no built-in refresh for out-of-band updates like email verification or updates that happen on another device.

There are a few common ways to deal with this scenario, polling being one of them (although every 2 seconds seems a bit excessive).

For more on this exact problem, see Angular firebase email verification false after verify, and the links I included there.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807