I've recently started working with Firebase and I'm encountering some issues with the security rules.
My project is a blog website where visitors can read posts, users, and comments without being logged in. However, logged-in and verified users have the ability to create posts.
Below are the security rules I have set:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if true;
allow write: if request.auth.uid != null;
}
}
}
I've received emails from Firebase stating that the rules are not secure because "any user can read your entire database". Is there something I'm overlooking? I want non-logged in users to be able to read the data.