https://supabase.com/ logo
My site is not not letting people register now for...
# help
b
My site is not not letting people register now for some reason. I've had this happen one other time and restarted the server and seemed to work but not this time. Any ideas?
n
Hello @big2tiny! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
b
I just get "Database error saving new user"
@User My site is not not letting people register now for some reason. I've had this happen one other time and restarted the server and seemed to work but not this time. Any ideas?
g
Do you have a trigger function? Is there any info in the database postgres log? You don't need to shout support. That really does not do anything here. This is mainly a user helping user forum with participation by employees when they can. If you did not change anything contacting support thru help tab on a running site is probably best even while you discuss your issue here.
b
I do, I am creating a profile whenever a user signs up
g
That would be my first thing to look at with a 500 error. The log might have info if it is the function doing something.
b
Okay I'll look at that
Thanks! Fixed it. This morning I was trying to add the username to be initially populated with the users email. I must have done. something wrong. this is the before and after. Any Ideas what I did wrong?
g
You need to use new for that also.
b
so...new.auth.users.email?
g
new.email
new is an object that has all the columns being inserted
b
the field im populating is username. new.email will add the users email to username?
g
That is what you are telling it to do. There is no username column in auth.users
b
Sorry for the dumb questions...just making sure I'm getting it right.
g
The names of columns don't matter to the system as long as they are the same type (text) it will insert the email column from auth.users into your profiles table column username. I personally would use email for the name of column there too, but that is up to you.
b
Got it! It works as intended now! Thanks so much Gary!
I'm letting the users set the username and am just using it as a default unique value when they sign up. Then they change it.
g
👍
b
Thanks again Gary!