I have a unique claim "admin" attached to each user, containing a boolean value. Currently, in the frontend of my application, I am attempting to create a list of all administrators. To do so, I need to retrieve all users who have this specific custom claim set to "true" and store them in an array, from which I can easily generate the list. The array structure should resemble the following:
const admins = ref([
{
uid: *UID of admin1*,
name: *Name of admin1*,
},
{
uid: *UID of admin2*,
name: *Name of admin2*,
},
...
])
Unfortunately, I am facing the following challenges:
- How can I access all users with the custom claim set to true in order to iterate over them and populate my array?
- Would implementing a cloud function be a feasible solution to prevent manipulation?
Although I attempted to comprehend the information provided in this Firebase documentation, it did not provide much clarity.