I tried reading the first couple of answers but none seem to have the same rule with the one I currently have my hands on.
When I try to call the getDocs() function (using react)
JavaScript
x
2
1
let userInfo = await getDoc(doc(db, chargerInfo.userRef));
2
I seem to be getting the error FirebaseError: Missing or insufficient permissions.
what can I do to not get this error? Below is the rule that I have
JavaScript
1
6
1
match /devices/{id} {
2
allow read: if request.auth != null;
3
allow update: if request.auth != null;
4
}
5
```
6
Advertisement
Answer
You can change to:
JavaScript
1
5
1
2
allow read: if true;
3
allow update: if true;
4
5