https://supabase.com/ logo
Hey yall. I'm having a little trouble with writing...
# help
t
Hey yall. I'm having a little trouble with writing RLS policies when using custom auth JWTs. According to this thread (https://github.com/supabase/supabase/discussions/1849), you should be able to write the policy using something like
auth.someclaim() = mytable.somecolumn
but when I try to read a custom property of the custom JWT token in the RLS policy editor, I get this error. Any ideas?
n
Hello @trebor! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! 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.
t
Found the correct way to read jwt claims posting for anyone who needs:
Copy code
(((current_setting('request.jwt.claims'::text, true))::json ->> 'address'::text) IS NOT NULL)
s
One of my wrote a really good guide on using custom claims with supabase https://github.com/supabase-community/supabase-custom-claims