{"code":"PGRST301","details":null,"hint":null,"message":"JWSError JWSInvalidSignature"} error whenever I need to execute some kind of update or insert. It does not error out when it's a query for reading. create policy "update UserPet based on matching user wallet_address"
on "public"."UserPetFood"
as permissive
for update
to anon
using (((auth.jwt() ->> 'wallet_address'::text) = wallet_address))
with check (((auth.jwt() ->> 'wallet_address'::text) = wallet_address));
create policy "Enable read access for all users"
on "public"."UserPetFood"
as permissive
for select
to public
using (true);
create policy "insert into UserPetFood based on matching user wallet_address"
on "public"."UserPetFood"
as permissive
for insert
to anon
with check ((EXISTS ( SELECT 1
FROM "UserPet" up
WHERE ((up.id = "UserPetFood".user_pet_id) AND (up.wallet_address = (auth.jwt() ->> 'wallet_address'::text))))));