Clerk Role Based Auth
Hi, how do you deal with role based auth using clerk? I have 3 roles: Admin, Moderator and User. All users have the role User by default. And the User can't access Admin or Moderator pages. I can't find any resources about that.
5 Replies
I guess you can set that on privateMetadata on the User object
https://clerk.com/docs/users/overview
There are roles in context of Clerk's organization, but I also couldn't find anything for user roles
The User object | Clerk
The User object models a user's account information.
This is the approach im using. However I'd recommend using publicMetadata since that can be read on both Client side and server side
correct public metadata is the correct choice
And the users role isn't necessarily private
we don’t have roles for B2C at the moment