18

I used Firebase Quickstarts for Android Auth sample, Then I created a user in firebase dashboard to login the user with email and password, the user logged in successfully. But when I deleted the user, it still logged in and showing the old user's email from (user.getEmail())

// [START auth_state_listener]
    mAuthListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            FirebaseUser user = firebaseAuth.getCurrentUser();
            if (user != null) {
                // User is signed in
                Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getEmail());
            } else {
                // User is signed out
                Log.d(TAG, "onAuthStateChanged:signed_out");
            }
            // [START_EXCLUDE]
            updateUI(user);
            // [END_EXCLUDE]
        }
    };
    // [END auth_state_listener]

No users in my firebase dashboard and the AuthStateListener indecate that the user is signed in.

how could that be possible ?

Abdalltif Basher
  • 617
  • 7
  • 19

1 Answers1

1

When you delete a user from the Firebase dashboard, the user is not immediately signed out of your app. If the user is active in your app, they will be automatically signed out after a short delay. If you want to sign the user out, you will need to invalidate their session token.

The following code can be used to invalidate a user's session token in Firebase:

 firebase.auth().signOut()

I hope it would be helpful.

Sparko Sol
  • 651
  • 1
  • 9