I am relatively new to web dev, so forgive me if I am doing something boneheaded here. To get acquainted with Supabase I am simply trying to achieve logging in with a script and inserting a row to the database with RLS on.
I am using nodeJS v18.9.0 with TypeScript 4.8.4 on a Mac on the desktop.
I made a table called 'testTable' that just has simple 'test' varchar column. I created a policy allowing "authenticated" users to Insert on the same table.
The error I keep getting is code 42501, 'new row violates row-level security policy for table "testTable"'.
Why am I posting here? I am unsure as to whether I am logging in correctly, and it could be as simple as that.
In the example code I pasted, am I logging in correctly? Do I need to store the users tokens or something that somewhere and pass them to the insert command somehow? Or is the supabase API taking care of all of that for me?
If I am logging in correctly then I guess I need advice on setting up the RLS policies.
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.