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
kepuczito42013mo 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
Josh13mo 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 Perkins13mo ago
correct public metadata is the correct choice
Josh
Josh13mo ago
And the users role isn't necessarily private
James Perkins
James Perkins13mo ago
we don’t have roles for B2C at the moment