© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
28 replies
xkenneth86

Basic Auth + Policies Help

Hey Everyone,

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.

Here's what my TypeScript type looks like: https://pastebin.com/Eu63D34B

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.

Thanks for your time.
Ken
image.png
image.png
image.png
Pastebin
//nodeimport * as fs from 'fs';import * as path from 'path';//node_...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

help needed with setting up basic RLS policies
SupabaseSSupabase / help-and-questions
14mo ago
Basic auth issue
SupabaseSSupabase / help-and-questions
3y ago
Auth helpers
SupabaseSSupabase / help-and-questions
3y ago
Need help defining security policies
SupabaseSSupabase / help-and-questions
13mo ago