用户注销时的Firebase规则';缺少权限或权限不足。错误:缺少或权限不足';

用户注销时的Firebase规则';缺少权限或权限不足。错误:缺少或权限不足';,firebase,google-cloud-firestore,logout,firebase-security,Firebase,Google Cloud Firestore,Logout,Firebase Security,错误: service cloud.firestore { match /databases/{database}/documents { // Match any {project} document in the 'projects' collection match /projects/{project} { // Allow signed in users to read write projects allow read, write: if re

错误:

service cloud.firestore {
  match /databases/{database}/documents {
  // Match any {project} document in the 'projects' collection
    match /projects/{project} {
     // Allow signed in users to read write projects
      allow read, write: if request.auth.uid != null; 
    }
    // Match any {user} document in the 'users' collection
    match /users/{user} {
     // Allow users to signup and create an account
      allow create;
      // Allow signed in users to read project details - who create project and when)
      allow read: if request.auth.uid != null;
      // Allow signed in user to update his info only if signed in id == user document id
      allow update, delete: if request.auth.uid == user;
    }
  }
}
'配置文件侦听器出错:缺少权限或权限不足。错误:缺少或权限不足。'

我的应用程序是使用Reactjs、Redux和Firebase构建的项目经理。 你能告诉我为什么用户注销时会出现这个错误以及如何解决它吗

我的规则:

service cloud.firestore {
  match /databases/{database}/documents {
  // Match any {project} document in the 'projects' collection
    match /projects/{project} {
     // Allow signed in users to read write projects
      allow read, write: if request.auth.uid != null; 
    }
    // Match any {user} document in the 'users' collection
    match /users/{user} {
     // Allow users to signup and create an account
      allow create;
      // Allow signed in users to read project details - who create project and when)
      allow read: if request.auth.uid != null;
      // Allow signed in user to update his info only if signed in id == user document id
      allow update, delete: if request.auth.uid == user;
    }
  }
}

如果在您注销时发生这种情况,则意味着您仍然有一个附加到需要对用户进行身份验证的集合的。当您注销时,该侦听器将无效,因此安全规则将拒绝它


要删除该消息,请在用户注销之前删除所有此类侦听器。在您的特定情况下,“配置文件侦听器”似乎有问题。如果在您注销时发生这种情况,则意味着您仍然有一个附加到需要对用户进行身份验证的集合的。当您注销时,该侦听器将无效,因此安全规则将拒绝它


要删除该消息,请在用户注销之前删除所有此类侦听器。在您的特定情况下,“配置文件侦听器”似乎有问题。

当您注销任何现有订阅时,仍将订阅,您将收到该错误。您可以在注销前取消订阅,也可以将用户发送到另一个页面并从那里注销。当您将用户发送到另一个页面时,订阅应该被垃圾收集。这就是它在角度组件中的工作原理,至少不确定react的情况。

当您注销时,任何现有订阅仍将被订阅,您将得到该错误。您可以在注销前取消订阅,也可以将用户发送到另一个页面并从那里注销。当您将用户发送到另一个页面时,订阅应该被垃圾收集。这就是它在角度组件中的工作方式,至少不确定react。

您的规则(代码段第6行)指定只有经过身份验证的用户才能读取或写入数据。您可以发布注销的代码示例吗?客户使用什么语言编写?你能发布错误堆栈跟踪以确保问题是注销而不是其他问题吗?我添加了我的应用程序是使用Reactjs、Redux和Firebase构建的。我是个新手,所以我无法理解错误堆栈跟踪的含义?您的规则(代码段的第6行)指定只有经过身份验证的用户才能读取或写入数据。您可以发布注销的代码示例吗?客户使用什么语言编写?你能发布错误堆栈跟踪以确保问题是注销而不是其他问题吗?我添加了我的应用程序是使用Reactjs、Redux和Firebase构建的。我是个新手,所以我无法理解错误堆栈跟踪的含义是什么?你能举个例子吗?我看不到在哪里添加了这样的侦听器,所以我不知道如何删除它。我正在使用angular、ts和
AngularFireAuth
,而signout方法只调用
this.AngularFireAuth.auth.signout()AngularFireAuth
,而signout方法只调用
this.AngularFireAuth.auth.signout()