FirebaseExtended / firebase-auth-migration-helpers

Other
11 stars 8 forks source link

When exactly do we need to call AuthMigrator.getInstance().clearLegacyAuth(); ? #10

Closed mumayank closed 8 years ago

mumayank commented 8 years ago

I have been using Firebase for some time in my production app. Recently new firebase was introduced at google event. I decided to upgrade it for my app. I looked at the migration guide: https://firebase.google.com/support/guides/firebase-android and tried following every step. I understood every step but one. Section migrate existing login requires us to refer https://github.com/firebase/firebase-auth-migration-helpers/tree/master/android which says: Whenever you log in a user, call clearLegacyAuth(). This is a precaution to make sure that a user from a legacy SDK never overrides a newer log in. AuthMigrator.getInstance().clearLegacyAuth();

  1. I am using a custom login for firebase (generating firebase token on my server)
  2. I have updated libs required to generate new firebase token for the upgraded firebase as required.
  3. Server side works fine.
  4. Client side if new app tries login in user, it will do so using new firebase provided libs/ methods.
  5. That leaves me with doubt: when exactly do we need to call the method mentioned in this issue title?

Please help.

abeisgoat commented 8 years ago

I believe this method is called when the user first opens the app. This way you ensure that you wont have the old auth data sticking around.