From the course: React: Cloud-Powered Apps with Firebase

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Admin interface: Users page

Admin interface: Users page

From the course: React: Cloud-Powered Apps with Firebase

Start my 1-month free trial

Admin interface: Users page

- [Instructor] Now that we have used the Firebase Admin SDK to set custom claims for an admin user, it is time to start developing our admin interface which will allow the admin user to see all of the registered users and view and edit the profile data. Let's start by creating a new users page, and call it Users.js. Let's create our component here. We'll call this users. And for now let's just return a div with the text users in that div. Before adding a new route to our application, we need to do some work in UserProvider.js, the high order component, where we define the user context and where we get access to the user session. Here, we will want to get information about any custom claims in the user. In particular, we will check for the admin custom claim we previously set. So in addition to the user, let's add another property, isAdmin, and the initial value will be false. Now in the off state change callback, we…

Contents