How To Force Sign Out User If Return Error?

- 1 answer

How to force sign out user if return error ?
      .then(() => console.log("good"))
      .catch(() => {
        /*I still need to sign out user*/


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.