0

I am quite new to Supabase.

Basically, I am doing auth using Supabase and have this table called "profiles" with columns:

id - UUID username - text email - text

Now when I create a new account using Supabase, it works, the account gets registered and shows up in the auth tab, but the new row doesn't get inserted into profiles.

 user = response.user
 if user:
 resp = supabase.table("profiles").insert({
 "id": user.id,
 "username": username,
 "email": email
 }).execute()
 print(resp)
 request.session["user_id"] = user.id
 request.session["username"] = username
 return redirect("home")

Now, my RLS for the profiles table is:

  • Enable insert for authenticated users only,
  • INSERT,
  • anon, authenticated

and I am using a service key to create the Supabase client.

Even after all that, I keep getting the error:

APIError: {'message': 'new row violates row-level security policy for table "profiles"', 'code': '42501', ...}

halfer
20.2k19 gold badges110 silver badges207 bronze badges
asked 8 hours ago
New contributor
Charu Singhania is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.