S
Supabase•4w ago
stoozy

Issue with email confirmations on sign up

So I am trying to sign up new users but the confirmation email isn't sending (and it's immediately logging in the user). So far I've tried: 1. toggling email confirmation (seems to have no effect) 2. Switching from custom resend smtp service to default smtp settings 3. With and without additional options data
const { data: authData, error: authError } = await supabase.auth.signUp({
email: formData.email,
password: formData.password,
options: {
emailRedirectTo: redirect
? `${window.location.origin}${redirect}`
: `${window.location.origin}/login`,
data: {
first_name: formData.firstName,
last_name: formData.lastName,
},
},
});
const { data: authData, error: authError } = await supabase.auth.signUp({
email: formData.email,
password: formData.password,
options: {
emailRedirectTo: redirect
? `${window.location.origin}${redirect}`
: `${window.location.origin}/login`,
data: {
first_name: formData.firstName,
last_name: formData.lastName,
},
},
});
17 Replies
garyaustin
garyaustin•4w ago
Is this the setting you are using? Try the invite from the Dashboard. I just tested and it seems to be working.
No description
stoozy
stoozyOP•4w ago
yes I have tried the invite from the dashboard and it works (even with the resend smtp) I checked the logs as well, it directly goes from POST /auth/v1/signup to login ...
garyaustin
garyaustin•4w ago
Are you sure the email does not already exist?
stoozy
stoozyOP•4w ago
I am using the + alias to allow multiple accounts so like email+1@gmail.com and email+2@gmail.com should both be going to email@gmail.com but act as different accounts
garyaustin
garyaustin•4w ago
So the invite sends the email and does not set the user as signed in until you click the link? Signup returns to your code. It does not redirect. The redirect happens when click the email link and it confirms the email. If the email address already exists it does not error and returns to your code with a fake user.
stoozy
stoozyOP•4w ago
I'm not sure what you mean. The same code was working before, I was getting sign up confirmation emails even when that option for requiring email confirmation was turned off (I have no idea why).
garyaustin
garyaustin•4w ago
I would console.log right after signup and see what you are getting back. Your first post says you were NOT getting emails either way.
stoozy
stoozyOP•4w ago
I'm getting the user object and session data
garyaustin
garyaustin•4w ago
I'd generate an issue in supabase/supabase github issues. I can't check from my client right now as too late for me. BUT they did move that less than 24 hours ago. Wonder if it is stuck in old state.... https://github.com/supabase/supabase/pull/37573 Reference that....
stoozy
stoozyOP•4w ago
will do, thanks for your help
carlito944
carlito944•4w ago
I've had the same issue, wasted about 6 hours going around in circles! Ended up building a new project just to test the sign up flow and can confirm even with the toggle on the confirmation emails are NOT being sent. The Users are being auto confirmed immediately. The only solution was to switch to magic link sign up
garyaustin
garyaustin•4w ago
It should be fixed now.
stoozy
stoozyOP•4w ago
yea I was toggling the option on and off, changing the recipient email provider and such. Nothing worked lol I wasted 2 hrs 😭
carlito944
carlito944•4w ago
you got lucky!
stoozy
stoozyOP•4w ago
I mean at that point it just didn't make sense so I came here problem is still there for me wonder if hosting my own supabase would prevent problems like this
garyaustin
garyaustin•4w ago
I can confirm it is working correctly now. Toggling does the correct thing. Hard refresh your browser, maybe the dashboard still has the old code cached.
stoozy
stoozyOP•4w ago
yes that was it its working

Did you find this page helpful?