supabase-js createServerClient doesn't work with service role?
I can use the service role in a NextJS Route Handler to bypass RLS. This code works:
If I follow the docs for NextJS (https://supabase.com/docs/guides/auth/server-side/creating-a-client?environment=route-handler)
It works when using the anon key but not the service role key:
The
I guess it doesn't really make sense to use the user's cookies as these aren't relevant when using the service role. Should I just use
If I follow the docs for NextJS (https://supabase.com/docs/guides/auth/server-side/creating-a-client?environment=route-handler)
It works when using the anon key but not the service role key:
The
console.dir returns a status of 200 and no errors but the database isn't updated. I guess it doesn't really make sense to use the user's cookies as these aren't relevant when using the service role. Should I just use
createClient as I did in my first code example?