SupabaseS
Supabase2y ago
Tom

Assigning auth users to different 'user type' tables on sign up?

I'm trying to have a flow where once a user signs up, I want them to be added to a table depending on the platform they used to sign up with (Web app or mobile), so 'Customer' or 'Supplier' tables.

I looked into supplying user meta data with an 'accountType' variable that could be used in the sign up trigger to assign that user to the correct table, but read that it can be manipulated by the user? I also saw that you can't add that metadata when signing up with Oauth?

I'm a bit stuck on how to get this implemented, unless I move the flow backwards in the sign up process, so the auth is created (no assignment to a table) and then once they have a session, they can move through the sign up process and i'll call a manual function to assign them to the correct table, dependant on the platform code.
Was this page helpful?