I am trying to add additional data in a user record in supabase
, I have created a trigger that is called after a record has been inserted in auth user that should add the user id and username in the profiles table. This happens but it doesn't add the user name, it's still null
in the profiles table. That data is supposed to go in the raw_user_meta_data
column but it still doesn't add in the column
Trigger function:
BEGIN
INSERT INTO public.profiles(id, username)
VALUES (
NEW.id,
NEW.raw_user_meta_data -> 'username'
);
RETURN NEW;
END;
Front:
const createNewUser = async() => {
const { username, email, password } = credentials;
await supabase.auth.signUp({
email: email,
password: password,
data: {
"username": 'hello'
}
});
}