firebase.logout calls auth.signOut which returns a promise.
However firebase.logout is rather presumptuous in assuming that stuff just happens instantly and always working, returning a Promise.resolve, leaving some state in limbo, rather than waiting for state to be pristine and things to be entirely cleaned up under the hood.
Easy fix, something along the lines (but untested):
export const logout = (dispatch, firebase) => {
return firebase.auth().signOut().
then(() => {
dispatch({ type: LOGOUT })
firebase._.authUid = null
unWatchUserProfile(firebase)
return firebase
})
}
@Domiii Good catch, this will for sure make it into the next pre-release of 1.5.0. This seems to be around from quite a while ago.
v1.5.0-beta.2 was released with this fix. Thanks again!
Most helpful comment
@Domiii Good catch, this will for sure make it into the next pre-release of
1.5.0. This seems to be around from quite a while ago.