Looks like there is a bug or limitation in how FlutterFlow handles anon roles with supabase auth and supabase as a database. I have RLS enabled, tried to create a policy to "Allow Anon Inserts" for an onboarding table completed by the user before creating an account. With my policy, I keep getting errors thrown and no inserts accepted. I receive errors in safari console log like:
Failed to load resource: the server responded with a status of 401 ()
"message": "new row violates row-level security policy for table \"onboarding\""
In SupaBase, I receive 401 POST errors with null payloads in required fields I'm inserting, but role still shows an "anon". If RLS is disabled or if I change my policy to allow Public insert everything seems to work fine, data is inserted, no errors.
I have been able to simulate inserting data under the "anon" role within supabase and even using reqbin.com, and the data inserts fine, there are no issues. I have tried allowing anonymous sign-in but this doesn't affect it, not exactly sure how this would since this is for sign-in and not role.
Not sure why this bug is occurring, I have spent HOURS trying to fix this using Google, ChatGPT, and Claude and nothing works aside disabling RLS (which I don't want) or allowing public ALL (which I also don't want). FlutterFlow really needs to have better integration with SupaBase and also fix this error occurring with how it handles anon roles and RLS, or maybe I'm missing something but either way this is a big restriction.