Using new firebase 3.0.1 which was recently published by google.
Before, we had Firebase.unauth()
method https://www.firebase.com/docs/web/api/firebase/unauth.html
But it's old API. I can't see anything related in new API:
https://firebase.google.com/docs/reference/node/index-all
What are your solutions? Trying to use something like:
Object.keys(localStorage).forEach(key => {
if (key.indexOf('firebase') !== -1) {
localStorage.removeItem(key);
}
});
Lukas Liesis has the correct firebase signOut() method but to resolve a rejected promise, I used
.catch()
instead.catch error with callback:
or with .catch as Adam mentioned.
Or with await and
try...catch
if inside async functionhttps://firebase.google.com/docs/auth/web/password-auth#next_steps
thanks AndréKool for directions :-)
This statement logouts the user.