Search code examples
react-nativesupabasesupabase-database

AuthApiError: Database error saving new user with react-native/supabase


I created a react-native app using supabase as a backend. Everything was working fine, I created my first user, signed it, etc., but now I'm trying to create a new user and I'm getting this error:

[AuthApiError: Database error saving new user]

I don't understand what's causing the error, however, there seems to be a lack of communication between supabase and their auth API. When I try creating a new user with the same email (which needs to be unique) there's not error, but the auth doesn't work.

I created my supabase project and did all the starting steps for it to work, so I'm not sure what the issue is here. Wondering if I should switch backends or if this is a simple fix. Again, there isn't that much communication so I'm confused as to what the issue actually is.


Solution

  • This is generally caused by a trigger failing. Check in your Supabase dashboard if there is a trigger on the auth table, try disabling it and then see if it works.

    Also check out the troubleshooting steps on this page https://github.com/orgs/supabase/discussions/13043