When a user signs up in my app he gets a verification e-mail. The onAuthStateChanged
-listener gets called when a user gets created using createUserWithEma
onAuthStatechanged
is triggered only in case of user Login or Logout & not on Email verification.
As Per Doc -
onAuthStatechanged
Adds an observer for changes to the user's sign-in state.
The observer will be triggered in the following scenarios:
When auth().onAuthStateChanged() is first called. It will trigger with the initial Auth state. If the user is returning from an auth().signInWithRedirect() operation, the observer will wait for that operation to resolve before initially triggering.
When a new user signs.
When an already signed in user signs out.