joesaunderson
03/07/2022, 8:20 PM@supabase/supabase-auth-helpers
I have a profiles
table in the public
schema that is automatically created (via a trigger/function) when a user signs up (via email or a provider), I have a column on this table called role
which can be user
or admin
for now, depending on the signup flow.
I am struggling to set this role field when using the Auth
component in the helpers / when using third party providers.
With the email/password signup JS library it's possible to do:
supabase.auth.signUp({...}, {data: {role: 'admin'}})
which I can then access in my trigger/function to set the role on the profiles
table.
However, I am struggling to do similar (doesn't seem to exist) when signing in (or up) with a provider / when using the Auth
component.
Forgive me if I am missing something obvious here, but I would be grateful to see how others are doing similar. Thanks in advance.silentworks
03/08/2022, 12:02 AMsupabase.auth.signUp
yourself with the correct additional data, but you should use the supabase instance from the supabase-auth-helpers.joesaunderson
03/08/2022, 4:11 PMjoesaunderson
03/08/2022, 4:13 PM