Just wondering what's the best approach for multi-...
# off-topic
c
Just wondering what's the best approach for multi-tenancy? @User @User
e
Check out this discussion - https://github.com/supabase/supabase/discussions/1615#discussioncomment-759752 I personally prefer option 3 there
c
Hey thanks I'm going to check it out
Oh. Awesome I think this is great
@User Got a question, I don't know the reference of
current_user
e
in our RLS policies, you can get the currnet user id by auth.uid()
c
Ahh I see.. I also want to learn how you guys come up with that, is it taking the user from auth schema?
Postgrest exposes the request JWT claims - https://postgrest.org/en/v7.0.0/api.html#http-logic and we make use of that
the JWT itself is generated via Gotrue (our Auth server)
c
Ohhh wow thanks for sharing!!
(search for "create policy")
The best way to see how everything fits together is look the video Ant made -

https://www.youtube.com/watch?v=v3Exg5YpJvE

c
Thank you so much man 🙏 🙏 💪 I'll definitely be checking these out, I'm going to build a SaaS
e
🚀 🚀