Question Regarding User Creation Flow in Supabase and Database Synchronization #93
-
Hello team, I've been exploring the project and trying to set it up locally. I've come across a behavior I'd like to clarify concerning the user creation process, especially in relation to Supabase and the database synchronization. When I attempt to sign up a user, I observed the following:
Given the above, I have a few questions:
I appreciate the work you've put into this project, and I'm eager to understand it more deeply. Any guidance or insights would be immensely helpful. Thank you for your time! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @saurabhchalke Glad you liked this app (Do support by giving a star) and i will try to answer your questions below.
If you follow the above steps, you should be able to run the app locally. Let me know if you have any more questions. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed response. I've followed your guidance and managed to set things up successfully. Specifically, I created the following trigger + function on Supabase to handle the user creation process: /**
* This trigger automatically creates a user entry when a new user signs up via Supabase Auth.
*/
create function public.create_user_on_auth()
returns trigger as $$
begin
insert into public.users (id, email)
values (new.id, new.email);
return new;
end;
$$ language plpgsql security definer;
create trigger create_new_user
after insert on auth.users
for each row execute procedure public.create_user_on_auth(); This did the trick for me and everything's working as expected now. Thank you once again, and I'm looking forward to contributing and learning more from this project. |
Beta Was this translation helpful? Give feedback.
Hi @saurabhchalke Glad you liked this app (Do support by giving a star) and i will try to answer your questions below.
Supabase Triggers/Function
- Yes you need to setup a trigger function in supabase. This is the trigger function i am using. You can follow the docs in supabase on how to set it up.Local Development:
Yes you need to setup ENV keys into.env
file to run the app in your local. You can find required keys in example.env.These should be enough to get the app up and running in local
Additional Mechanisms
- None. Once the user dat…