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', ...}