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
kepuczito420
kepuczito4202y ago
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.
Josh
Josh2y ago
This is the approach im using. However I'd recommend using publicMetadata since that can be read on both Client side and server side
James Perkins
James Perkins2y ago
correct public metadata is the correct choice
Josh
Josh2y ago
And the users role isn't necessarily private
James Perkins
James Perkins2y ago
we don’t have roles for B2C at the moment
Want results from more Discord servers?
Add your server