thats my function snippet, hope it helps: ``` -- i...
# help
p
thats my function snippet, hope it helps:
Copy code
-- inserts a row into public.users
create function public.handle_new_user() returns trigger language plpgsql security definer
set
  search_path = public as $$
begin
  insert into public.profiles (user_id, first_name, last_name)
  values (
    new.id, 
    new.raw_user_meta_data->>'first_name', 
    new.raw_user_meta_data->>'last_name'
  );
  return new;
end;
$$;
-- trigger the function every time a user is created
create trigger on_auth_user_created
after
insert
  on auth.users for each row execute procedure public.handle_new_user();
j
@User did you have to do something to the user table, add these fields, prior to this working? I have the same set up, and it works for email and id, but not anything defined in the data object.
p
To the user table?
Nah
Paste a snippet of the signup function