Hi all! I set up Supabase auth on the server using...
# help
j
Hi all! I set up Supabase auth on the server using Express, and the sign up works just fine. However, when I try to login, I get an error saying that the email has not been confirmed. I checked my settings and I have email confirmation turned off. Has anyone experienced this?
n
Hello @jvocodes! 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.
s
Have you tried deleting the user and then signing up again?
j
Hi @snowshift Thank you for the reply! I deleted the user and signed them up again. But I get the same result. The sign up works just fine, but when I try to sign in it says 'Email not confirmed'
s
Interesting, just to double confirm -- enable email confirmation is off like this?
j
Yep, the only difference is that I do not have "Enable Custom SMTP" enabled - but otherwise it looks exactly the same.
s
Testing with my project
Does it show
email_confirmed_at
in your
auth.users
table?
I just turned off
Enable Custom SMTP
and still works
j
It shows null in my
Copy code
auth.users
table
Sorry, wrong screenshot the first time 🙂
s
Interesting, there isn't any gotcha's when working with Supabase auth that I know of. I see that the row
email_confirmed_at
isn't getting updated and is the reason why you are getting the error
j
Is that possibly related to doing this server side via Express?
Or, if it allows me to signup, does that make it seem like everything should be working?
s
I think it works the same as in frontend
Copy code
js
const { data: user, error } = await supabase.auth.api.createUser({
  email: 'user@email.com',
  password: 'password'
})
j
Ok, yeah that's what I've got in my server side code too
s
because you mentioned users are showing in your auth table
Copy code
js
const { data: user, error } = await supabase.auth.api.createUser({
  email: 'user@email.com',
  email_confirm: true
})
let's try this
(I'm new to server side with Supabase but I think* this should do it ^)
j
Ok sounds good - leave out the password field then?
s
leave in
j
Ok, that set the email_confirmed_at column to the date value
s
did it work?
I think that should do it :))
j
Hey it worked! Awesome! I'm able to sign in now.
s
yay!
j
Does the email_confirm actually send an email confirmation then? Or is that unrelated to the email confirmation?
s
I don't think so since in settings, that is off
j
Ok cool. Thank you so much! I really appreciate your help. I'm pretty new to all this so you've been really helpful!
s
Excited to see new stuff you're learning/building!
j
Awesome, have a great night!