Multiple roles for users in organizations
Hey!
I recently found Better Auth and it's wonderful, have been setting up now to use JWTs so that I can pass it to my different backends. Didn't quite figure out how to verify the signed cookie without doing a database-call so I opted for what I have been using with Auth0. Perhaps if someone knows about that please let me know.
But to the question, my use-case includes organizations, so I'm using the plugin for that. However, I notice that the "role" field is in singular, and to me it doesn't seem possible to do anything other than just map the field to another name. I could do something like attach roles to the user, but that stops me from becoming as granular as I'd like, since in some cases one user would need to have different roles for different organizations. And also I'd like to include the permissions in my JWT, seems like a common practice as well so maybe someone here has done it?
So, in essence, does anyone know how to have multiple roles per org-member? If it's possible?
Thanks,
Albin
I recently found Better Auth and it's wonderful, have been setting up now to use JWTs so that I can pass it to my different backends. Didn't quite figure out how to verify the signed cookie without doing a database-call so I opted for what I have been using with Auth0. Perhaps if someone knows about that please let me know.
But to the question, my use-case includes organizations, so I'm using the plugin for that. However, I notice that the "role" field is in singular, and to me it doesn't seem possible to do anything other than just map the field to another name. I could do something like attach roles to the user, but that stops me from becoming as granular as I'd like, since in some cases one user would need to have different roles for different organizations. And also I'd like to include the permissions in my JWT, seems like a common practice as well so maybe someone here has done it?
So, in essence, does anyone know how to have multiple roles per org-member? If it's possible?
Thanks,
Albin