We have admin pages on our React website using Next.js. Our user types are defined in Cloud Firestore, but checking the user type for admin-only pages incurs a cost for each read operation. To mitigate this, we considered using custom claims. However, we’ve read that custom claims should be managed in a secure Firebase Admin SDK environment on a server.
We are concerned that this approach might not be the most efficient solution. We aim to maintain continuous communication between our frontend and backend to set a custom claim for each newly created user and to read each user type.
Is there a simpler, less complex method to achieve this?
BVW is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.