https://supabase.com/ logo
#sql
Title
# sql
d

dmytro.eth

02/21/2022, 9:27 AM
Hi all! Exploring the Supabase and it looks really nice, but have a question regarding the SQL part. I'm implementing the custom auth flow. I also want to support Supabase native authentication methods at the same time. So the idea is to plug users from my flow into
auth.users
table so that I can reference both native auth and my auth users from the same table. I dont get how to add documents into
auth.users
. Should it be some custom trigger?
s

silentworks

02/21/2022, 9:28 AM
How are you implementing your own auth flow?
d

dmytro.eth

02/21/2022, 9:32 AM
I utilise the crypto wallet signature and provide a JWT token.
s

silentworks

02/21/2022, 9:41 AM
Is this happening on the server side of your app or inside a Postgres function?
d

dmytro.eth

02/21/2022, 9:42 AM
Sorry for not being detailed enough. This is happening on the server side.
Currently, I have a separate table for users who logged in via the wallet at
public.wallet_auth
where I create uuid for them. Would it make sense to put a trigger on it to push a new entry to
auth.users
? I basically want to create a user profiles which would reference the uuid from
auth.users
to ensure the integrity
I'm not sure what's the best practise here, maybe it's a bad idea to mix
auth.users
with custom flow auth in the first place? Especially, considering that wallet auth is coming.
s

silentworks

02/21/2022, 4:41 PM
Hmm this might be a bit tricky, but you would need to make sure you are using the same hash mechanism for passwords as Supabase is using when storing an entry inside of the
auth.users
table
d

dmytro.eth

02/22/2022, 9:38 AM
Got it thanks! I decided to go with with separate table for wallet auth users for the sake of simplicity.