You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE OR REPLACE FUNCTION public.handle_new_user()
RETURNS trigger
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO 'public'
AS $function$
BEGIN
INSERT INTO public.profiles (id, profile_picture)
VALUES (new.id, (SELECT raw_user_meta_data ->> 'avatar_url' FROM auth.users WHERE id = new.id))
ON CONFLICT (id) DO NOTHING; -- Prevents error if the profile already exists
RETURN new;
END;
$function$;
https://boardshape.com/engineering/how-to-pull-google-profile-through-on-account-creation-with-supabase
The text was updated successfully, but these errors were encountered: