pwa-module
pwa-module copied to clipboard
Question - Auth strategy for when in offline mode
Hello,
This is a question for advice on best practices with auth covered routes in PWA. I am using the nuxt/firebase module for handling user auth.
When a user is in offline mode and loads a protected route, the firebase module gets stuck in that it cannot authenticate because it is offline.
What is the proper way to handle this in PWA offline mode?
I would refer to browser storage with some credentials that are not sensitive e.g store a uid in cookies with some other metadata and set some kind of expiry while using that as a source of truth till you get back online. I haven't really thought it out properly though.