DEV Community

Discussion on: To the Stars with Quasar & Firebase - User Profile

adamkpurdy profile image
Adam Purdy Author

Hey @gicelte you need to implement the setCustomUserClaims on the server side of things via Firebase Admin.

On my service side of things in my applications I just add a simple prop in the method call.

await admin.auth().setCustomUserClaims(authUser.uid, {
  isAdmin: true
Enter fullscreen mode Exit fullscreen mode

Then will do an await call on the client to route the user based on perms set on the user's auth record coming back from Firebase auth.

This is a start but by no means a thorough approach as user roles can be extensive in an application. For an in-depth setup explanation of setCustomUserClaims try googling: 'role based auth with firebase admin tutorial'.

Hope that gave you enough to point you in the right direction.