Firebase Auth login state persistence is not working

前端 未结 1 1450
小蘑菇
小蘑菇 2021-01-24 17:48

On an ionic/AngularJS/Cordova IOS app.

I\'m trying to set a persistence login using mail/password (followed Firebase documentation : https://firebase.google

相关标签:
1条回答
  • 2021-01-24 18:27

    To persist your state, you should use firebase.auth.Auth.Persistence.LOCAL and not firebase.auth.Auth.Persistence.SESSION.

    There are known issues with localStorage in Cordova iOS apps being volatile. Firebase Auth used to rely on localStorage but the latest version uses more reliable indexedDB to persist the user state. When this is not available, it falls back to localStorage. In that case, you could use this Microsoft plugin for indexedDB.

    tldr; migrate to the latest version of Firebase Auth and use the Cordova indexedDB plugin when indexedDB is not available.

    0 讨论(0)
提交回复
热议问题