I have a custom claim "admin" attached to each user, carrying a boolean. Now, in my frontend i am trying to generate a list of all admins. For that i need to access all users who have said custom claim set to "true" and put them in an array, which i can then generate the list from. The array should just look like the following:
const admins = ref([
{
uid: *uid of admin1*,
name: *name of admin1*,
},
{
uid: *uid of admin2*,
name: *name of admin2*,
},
...
])
So the following problems arise:
- How do i access all users with said custom claim set to true, so that i can loop over them and populate my array?
- Is this a case for a cloud function, so that it can not be manipulated?
I tried reading this Firebase documentation, however i could not make sense of it.