👋 Hi there! I'm having a hard time setting up a s...
# help
e
👋 Hi there! I'm having a hard time setting up a simple "only auth users can insert" RLS policy on a table. I've followed these docs [0] and tried both a "all can select" policy as well as passing
returning: minimal
on the insert call, but I still get blocked by RLS (code
42501
). The user has
role: authenticated
and
aud: authenticated
when I log it to the console, so I'm having a hard time figuring out where the disconnect is. 🤔 Any and all help is appreciated! 🙏 [0] https://supabase.com/docs/reference/javascript/insert#notes
n
Hello @eoin! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
🆕 RLS blocking even with all can select policy and
returning minimal
e
Ah, it's probably that the user on the client isn't passed to the /api/create endpoint in my Next app. I'll dig into the
supabase.auth
stuff once I'm back to my laptop and see if I can grab/pass the user from there.
Went from this issue [0] to actually reading the docs on protected routes using the auth helpers [1] and got it working with RLS enabled. Thanks so much to @thorwebdev for all of the async help throughout the issues and docs. 🙏 ✨ [0] https://github.com/supabase/supabase/issues/347 [1] https://github.com/supabase-community/supabase-auth-helpers/blob/next/src/nextjs/README.md#protecting-api-routes
n
Thread was archived by @eoin. Anyone can send a message to unarchive it.
RLS blocking even with all can select policy and
returning minimal