1
votes

So I'm trying to nail down all of the potential ways Firebase Authentication 'verifications' could rack up quickly against the Firebase Pricing plan.

Please correct me if I'm wrong, but an auth verification counts against the pricing plan when:

  • User successfully signs in
  • User successfully creates an account
  • NOT when a sign in/creation fails for some reason

I can't find anything in the documentation about the firebase.auth().onAuthStateChanged() method counting against verification.

To check if the auth state has changed wouldn't you also have to check if the user is verified? If the refresh token has expired due to account deleted/disabled or email/password updated the account would have to be re-verified.

Is a 'verification' counted against the limit when .onAuthStateChanged() is ran at all?

1

1 Answers

2
votes

A listener to onAuthStateChanged notifies you of changes in authentication state that happen in your app. Attaching a listener does not in itself cause any changes in the authentication state. It does not count against any pricing quota.

Note that token refreshes also don't count against any pricing quota. The only priced part of Firebase Authentication is SMS verifications, which only happens when you call signInWithPhoneNumber to sign the user in.