Registered without email confirmation

When a user creates an account, it is created without an email confirmation, even if email confirmation is turned on in the dashboard. Im using the default SMTP service. Any ideas?
19 Replies
garyaustin
garyaustin2w ago
How are you creating the account?
tap2k.
tap2k.OP2w ago
const { data: userData, error: userError } = await supabase.auth.admin.createUser({ email, password, email_confirm: true, }); Im using the service key to create the client, should I use the anon key instead? Checked the docs I am supposed to use the service key. What am i dont wrong?
garyaustin
garyaustin2w ago
Try email_confirm:false I believe true marks the address as confirmed versus sends out a mail to confirm it.
tap2k.
tap2k.OP2w ago
lol thats a bit counterintuitive but will try OK now its not automatically confirmed but Im not receiving the confirmation email
garyaustin
garyaustin2w ago
Check the auth logs for error. Using the built in SMTP even for debugging is not a great idea with 3 emails per hour (even with error not sending) and higher rate of spam filters blocking.
tap2k.
tap2k.OP2w ago
OK. No relevant errors in auth log and not in Spam. But Ill try with my own SMTP No luck with Google SMTP either
garyaustin
garyaustin2w ago
Have you done any auth hooks (like for email)? No known issues with this. And if you are not getting confirmed automatically now seems like you are sending or should see an error. Anything in the Auth logs at all for the user creation?
tap2k.
tap2k.OP2w ago
Nope. Last log message says "audit_event" Actually: /admin/users | request completed The outgoing email is not in my SMTP logs so I assume its not being sent properly Any ideas on how to debug this?
garyaustin
garyaustin2w ago
Not without errors. I just tried the dashboard though and it did not send either. Check in auth.users and see if there is even a confirmation token in the auth.users table. I would expect there to be one for the email to send. I've asked another mod to try it and see if they see same thing.
tap2k.
tap2k.OP2w ago
You are in my dashboard?? nope no confirmation_token nor confirmation_sent_at In the dashboard 'Confirm email' should be set to ON right?
garyaustin
garyaustin2w ago
No. I have no access to your instance. In my dashboards. You want it off so it sends email.
tap2k.
tap2k.OP2w ago
Ah let me check that Nope thats not it either fwiw I was talking about the dashboard toggle, where it says "Confirm email Users will need to confirm their email address before signing in for the first time". This seems really counterintuitive if it needs to be off to send the confirmation. In any case, neither setting worked for me Let me know if you find out anything more about this issue
garyaustin
garyaustin2w ago
Another mod confirms broken. I have bumped it to Supabase.
tap2k.
tap2k.OP2w ago
Any update on this?
garyaustin
garyaustin2w ago
Nope. An auth engineer got our info with 4 instances failing that day. What is odd is no one else is reporting it... But 2 mods confirmed both with custom and built in SMTP on 4 instances.
tap2k.
tap2k.OP3d ago
Any updates?
garyaustin
garyaustin3d ago
Sadly nothing and oddly no other reports but yours and the two mods confirming it. I've not retested to see if there. Must be most don't use the send email to confirm option.
tap2k.
tap2k.OP3d ago
Seems very odd unless people arent using the email auth at all
garyaustin
garyaustin3d ago
Lots use email auth. Very few would use admin.createUser. They would just use .signUp(). The issue is not with confirming emails, but with the admin call seeing the flag.

Did you find this page helpful?