0

I am using Supabase and I have RLS enabled on my database table but I can still read data with the anonymous key. Why is this?

RLS enabled

const { createClient } = require('@supabase/supabase-js')

const supabaseUrl = "https://jnalzpuoivntwiythznc.supabase.co";
const supabaseAnonKey = "MY_ANON_KEY";

const supabase = createClient(supabaseUrl, supabaseAnonKey);

(async function getData() {
  const {data, error} = await supabase
        .from("vaults")
        .select("*");
  console.log(data);
})();
Jordan Baron
  • 141
  • 1
  • 12
  • do you have any RLS policies for this table? should be able to see the list here https://app.supabase.io/project/jnalzpuoivntwiythznc/auth/policies – Awalias May 19 '22 at 03:08
  • otherwise you can confirm that the anon key you're using is correct by decoding it here https://jwt.io (note that the `service_role` key will bypass RLS) – Awalias May 19 '22 at 03:09

0 Answers0