Supabase stores authentication-related information (unique ID, email, password, etc.) in the auth.users table when users sign up. The auth schema i...
For further actions, you may consider blocking this person and/or reporting abuse
Hello Sebastian!
Thank you for making this great and useful article, I'm trying to add email address as the username whenever a user record is created, but I don't clearly know how to implement that. Is there any way to achieve that?
Hi Sina,
Sorry for the late reply!
First, you should add an
email
column to theprofile
table:Then, you can access the
email
column from theauth.users
table to insert the right value:The function
create_profile_for_new_user
is used as anAFTER INSERT
trigger for theauth.users
table. SoNEW
within this function refers to the new row inserted into theauth.users
table and thus allows you to access every column of it.Hope this helps! :)
Thanks for sharing how to save data from a Third-Party provider! Very helpful!
It was really helpful , thankyou
Hi Sebastian!
Thanks for this amazing article, trying this as well. but hitting a error when even using the plain ID only function.
I'm using GitHub as my login, but I always get redirect with:
http://localhost:3000/?error=server_error&error_description=Database+error+saving+new+user
Is there any way to see what would be wrong?
-- Edit
Managed to get it working with the following:
Hi Chris!
I assume the use of:
doesn't work with GitHub?! π€
The following PR has introduced this feature: github.com/supabase/gotrue/pull/127
I haven't had time to look deeper into this, but the
gotrue
repo of supabase should be the right place to investigate (or open an issue).Glad you could fix it and you enjoyed the article!
Hello Sebastian.
Thank's for sharing your knowledge with all of us..
Your article help me so much.!!
Can you help me with this:
When the user sign up...
How can you check if the email exists in auth.users table?
Hi Dimitris!
The
supabase.auth.signUp
function automatically checks if a user already exists. (See supabase.com/docs/reference/javasc... for further info.)Is that what you mean?
Best regards,
Sebastian
I'm using standard email and password sign up and passing data property in the second argument of supabase.auth.signUp(). I see this in the docs but I see no mentions of how to access it or view it in the admin.
How can I go about inserting meta data from signUp() into my profile table?
Thanks!
Hey, hope you've figured it out by now, still wanted to add this for future reference
This should work using
which I found in Discord.
Thanks for sharing this article. I was having an issue and I believe this will solve it. I appreciate it.
Really helpful article, thank you!!
hi @sruhleder I am getting this error while sign up in supabase i have taken the above steps still i am getting this error AuthApiError: duplicate key value violates unique constraint "user_pkey"