Skip to content
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

Open
thorwebdev opened this issue Mar 6, 2024 · 4 comments
Open

Use new Auth Hooks approach? #70

thorwebdev opened this issue Mar 6, 2024 · 4 comments

Comments

@thorwebdev
Copy link

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 💚

@tiniscule
Copy link
Contributor

Love this - thanks for the recommendation I'll look at leveraging it.

@vbylen
Copy link

vbylen commented Aug 15, 2024

would be interesting to know if there is a performance gain

@kylerob
Copy link

kylerob commented Jan 14, 2025

@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!

@tiniscule
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants