I have 2 apps (admin and clients) using the same firebase database, first configure the admin app, then from the "project configuration" create the clients app in "Add another app".
service cloud.firestore {
match /databases/{database}/documents {
match /clients/{document=**} {
allow read, write: if true;
}
match /payments/{document=**} {
allow read, write: if true;
}
}
}
Without setting firebase rules (like the ones indicated above), the 2 apps work fine, I can read, edit, create and authenticate users. The problem happens when I start to set basic rules:
service cloud.firestore {
match /databases/{database}/documents {
match /clients/{document=**} {
allow read, write: if request.auth != null;
}
match /payments/{document=**} {
allow read, write: if request.auth != null;
}
}
}
with these rules it works fine in the admin app, but in the clients app it shows an error: ERROR FirebaseError: Missing or insufficient permissions; and does not allow read or write to the database.
edit
link right under it) to include the minimal, complete information with which any of us can reproduce where you are stuck (read the link please, as it contains a lot of information that'll make it more likely one of us can help). - Frank van Puffelen