Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Auth - progressive web app (polymer) offline mode

Does firebase auth still keep the user in offline mode of a progressive web app ?

How does firebase auth works if the app is in offline ? Would like to know the two scenario.

  1. User want to login for the first time during the app is in offline (app is using pouchDB & CouchDB for sync)
  2. User already signed in, but app became offline. Does this mode even still work with firebase auth ?

Regards, Sowmyan

like image 350
Sowmyan Soman Avatar asked Mar 20 '17 18:03

Sowmyan Soman


People also ask

Does Firebase Auth work offline?

By enabling persistence, any data that the Firebase Realtime Database client would sync while online persists to disk and is available offline, even when the user or operating system restarts the app. This means your app works as it would online by using the local data stored in the cache.

Is Firebase Auth slow?

Because it IS slow and for this reason you should avoid using it. Build your own authentication, like I did and you'll discover how significantly faster it is.

How long does Firebase auth session last?

By default, a session ends (times out) after 30 minutes of user inactivity. There is no limit to how long a session can last.

How do I use Firebase authentication on Web app?

Navigate to the Auth tab on your project from the Firebase Console. You shouldn't have any users configured, but they'll show up on this first screen once you do. Click the “SIGN IN METHOD” tab and enable the Email/Password and Anonymous sign in providers. We'll use only Email/Password and Anonymous.


1 Answers

Authenticating the user requires an active connection. There is no way for Firebase to authenticate your users without connecting to its servers.

Once the user is authenticated, the app will continue working when the user goes offline. Firebase Database operations will be reading from the local cache and writing to a queue. Once the connection is restored, the user's authentication token is (if needed) refreshed and the writes are sent to the server.

like image 183
Frank van Puffelen Avatar answered Nov 02 '22 20:11

Frank van Puffelen