gpt4 book ai didi

reactjs - 用户登录后如何调用 Firestore 数据库?

转载 作者:行者123 更新时间:2023-12-04 15:25:13 24 4
gpt4 key购买 nike

我正在尝试使用 React 设置 Firebase。我可以毫无错误地调用数据库 (Firestore),但是,每当我在登录后尝试调用数据库时,都会收到两条错误消息。错误仅在用户登录后发生。数据库的规则集是:

rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}

错误信息:

1) Firestore (7.15.0):无法访问 Cloud Firestore 后端。连接失败 1 次。最近的错误:FirebaseError:[code=unknown]:获取身份验证 token 失败:getToken 由于 token 更改而中止。

2) FirebaseError: 获取文档失败,因为客户端离线。

Picture of the error messages

Github Repo

最佳答案

听起来您在描述 7.15.1 中已修复的问题,因此我建议您进行更新。根据release notes :

Fixed an issue that prevented the client from connecting to the backend immediately after a user signed in. See GitHub issue #2923.

关于reactjs - 用户登录后如何调用 Firestore 数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62398254/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com