Relative Content

Tag Archive for reactjsfirebasegoogle-cloud-firestorenext.js

Implementing Firebase Security Rules to Allow Only Admin and Regular Users to Read and Write, While Keeping Sign-Up/Sign-In Functional

I need to establish Firebase security rules to allow only admin user types and regular users (for every user created in Firebase Authentication, a user document is written in Cloud Firestore where the user type is defined) to read and write. However, I still want to allow sign-up and sign-in pages to read and write, as sign-up pages create the user document and sign-in reads the user document to determine which page to take the user to. However, I am concerned that someone could potentially exploit these pages to perform excessive reads and writes. I am using react and nextjs.