-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new Auth Hooks approach? #70
Comments
Love this - thanks for the recommendation I'll look at leveraging it. |
would be interesting to know if there is a performance gain |
@tiniscule What are you latest thoughts on custom claims and Auth Hooks? I'm on the fence on if I want to go with the current basejump implementation and upgrade later if basejump changes, or roll with Auth Hooks now with a custom solution. Thanks for your hard work! |
I think it depends on your use case a bit - if you're working with personal accounts with only a few role levels, then I think it can make sense. If you're working with team accounts and foresee the role complexity growing more over time, then I think it can be a little problematic and error prone since you'd need to either implement your own per-account permissions structure (user 1 is admin of team 1 but member of team 2) or create some kind of per-team token that you swapped on your frontend to give them a team-specific custom claim. I'd seen a couple threads when Thor posted this about the table lookup performance being comparable to the custom claims, and so decided that I didn't know enough to determine what the best generic solution was. open to feedback if you think you've got a solid path forward that makes sense. Happy to make it part of core |
Hey there, thanks so much for this awesome project!
We've released some official guidance around custom claims & RBAC using the new Auth Hooks approach: https://supabase.com/docs/guides/auth/custom-claims-and-role-based-access-control-rbac
Would love if you could review and see if that would make sense to adopt for this project?
Thanks 💚
The text was updated successfully, but these errors were encountered: