Why firebase user still signed in after I deleted it from firebase dashboard

前端 未结 1 1976
猫巷女王i
猫巷女王i 2020-12-01 21:30

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.

相关标签:
1条回答
  • 2020-12-01 22:15

    Deleting an account does not automatically expire the current session(s) for that account. Their current sessions will remain valid until they expire. You can set the session expiration interval in your Firebase Dashboard.

    If you want to force the user to be logged out, call ref.unauth().

    But in general you'll likely want to build authorization rules to prevent such users with valid tokens from deleted accounts to make changes to the data.

    When a user updates their email, password or resets their password. Firebase Auth backend revokes their tokens requiring that they reauthenticate or try to sign in again. This is a security feature. For example a user may reset their password if their account was compromised. All other sessions must reauthenticate.

    If you keep the user profiles in your database, you can check whether that record still exists in your security rules: root.child('users').child(auth.uid).exists().

    Also see:

    • Firebase authentication not revoked when user deleted?
    • Deletion of User in firebase does not trigger onAuth method
    0 讨论(0)
提交回复
热议问题