Hi, has anyone run into this when signing up a use...
# help
y
Hi, has anyone run into this when signing up a user "message": "Database error saving new user", Im using the example from the docs for phone sign up, and also double checked all api keys for twillio and not sure why this isn't saving the user
s
There are many reasons this could be happening, can you provide some more details as to what you are doing?
y
sure heres my code
Copy code
CREATE FUNCTION
  public.handle_new_user()
  RETURNS TRIGGER AS
  $$
  BEGIN
    INSERT INTO public.users (id)
    VALUES (NEW.id);
    RETURN NEW;
  END;
  $$ LANGUAGE plpgsql SECURITY DEFINER;
CREATE TRIGGER on_auth_user_created
    AFTER INSERT
    ON auth.users
    FOR EACH ROW
    EXECUTE FUNCTION public.handle_new_user();
and here are the policies on my user table: Public users are viewable by everyone. true SELECT Edit Delete Users can insert their own profile. (uid() = id) INSERT Edit Delete Users can update own profile. (uid() = id)
all of this was used from the docs. i used the user management starter too that supabase provides. It actually worked before, but not sure why it stopped now
s
Can you point me to the phone sign up example in the docs you are using please? the one I found have no mention of a trigger and a trigger function