且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除后 Firebase 仍在检索 authData

更新时间:2023-12-01 16:04:52

删除帐户不会自动使该帐户的当前会话过期.他们当前的会话将一直有效,直到到期.您可以在 Firebase 信息中心设置会话过期间隔.

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.

如果您想强制用户登录出,调用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.

如果您将用户配置文件保存在您的数据库中,您可以检查该记录是否仍然存在于您的安全规则中:root.child('users').child(auth.uid).exists()代码>.

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().

另见: