How to create a new row in public.users_data when a new user is added to auth.User

So i have the following table
users_data (pk: email: text, first_name: text, last_name: text, phone_number: text, area_of_speciality: text, user_type: text, fk: organisation_id: int, created_at: timestamp, first_login: bool)

All values are allowed to be nullable except for the primary key. First_login field sets the default value to true.

So what is the best way to create a trigger that inserts the the email from auth.Users to public.users_data

I already tried this method
/**
* This trigger automatically creates a user entry when a new user signs up via Supabase Auth.
*/ 
create function public.handle_new_user() 
returns trigger as $$
begin
  insert into public.users_data (email)
  values (new.email);
  return new;
end;
$$ language plpgsql security definer;
create trigger on_auth_user_created
  after insert on auth.users
  for each row execute procedure public.handle_new_user();


but when i try to sign up via postman i get this response:
{"code":"23502","message":"null value in column \"email\" of relation \"users_data\" violates not-null constraint","detail":"Failing row contains (null, null, null, null, null, null, null, null, null, 2022-12-09 08:55:45.605194+00, f)."}%
Was this page helpful?