1

I am listening to AUTH changes:

  async onAuthStateChanged() {
    await firebase.auth().currentUser.reload();
    const unsubscribe = firebase.auth().onAuthStateChanged(async (user_auth) => {
        if (user_auth) {
            //user signed in
        } else {
            ///log out
            unsubscribe();
            this.props.navigation.navigate('login');
        }
    })
}

I call onAuthStateChanged() from onComponentDidMount() however it doesnt trigger it when I delete/disable a user from Firebase Console.

showtime
  • 1
  • 1
  • 17
  • 48
  • The user's token is good for 1 hour even if the user is deleted in the console. The listener will not be updated in real time. – Doug Stevenson Jan 22 '21 at 00:56
  • @DougStevenson that sucks big time. How am I suppose to just log a user out which I deleted ?! – showtime Jan 22 '21 at 03:02
  • Wait one hour. Or arrange to send the app a push message saying that the user was deleted and should be forced to log out using the auth api. – Doug Stevenson Jan 22 '21 at 03:21

0 Answers0