Ad

How To Force Sign Out User If Firebase.app().auth().signOut() Return Error?

- 1 answer

How to force sign out user if firebase.app().auth().signOut() return error ?

firebase.app().auth().signOut()
      .then(() => console.log("good"))
      .catch(() => {
        /*I still need to sign out user*/
      });
Ad

Answer

It is very unlikely you get an error in that case as this operation simply clears the state from local storage (localStorage, indexedDB, sessionStorage). The only possible error could be related to that (access to these local storages fails for some reason which is rare if you already were able to write to them). It would be better to show the error to the end user so they can take some other action such as clearing their cookies for the site, etc, especially if the user is using some shared device.

Ad
source: stackoverflow.com
Ad