Resend confirmation email #3526
-
Is there an option to resend the confirmation email when a user has signed up for a new account? I don't find a good reference for the admin API, but my best guess was using const { error, data } = await supabaseAdmin.auth.api.generateLink(
'signup', email, { redirecTo: 'url' }); It doesn't return any Any ideas are highly appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 28 replies
-
That would not send an email, it would generate a link which you could then send by your own means. I also think this function needs to be used with the Note: if you are using the |
Beta Was this translation helpful? Give feedback.
-
As of October 2021, it is not possible to resend the confirmation email. An issue has been opened in July 2021 to address this. The only way is to create the a link with Thanks @silentworks for the assistance. 👍 |
Beta Was this translation helpful? Give feedback.
-
@b2m9 I think I found a workaround. Please let me know of any side effects I might have missed. The initial confirmation email is sent on signup and there is no way in the client side sdk to resend it. However, if you keep track of the email address and password (in a variable; I'm not advocating writing the plain password anywhere else), you can just sign up again using the same credentials. As long as the email has not been confirmed, yet, it just overwrites the initial user entry and "resends" the confirmation email. The only limitation is a mandatory one minute timeout before signing up with the same email address again. |
Beta Was this translation helpful? Give feedback.
-
Just to clarify, are you looking to resend the confirmation email as an admin user to your users who have signed up but are not yet confirmed? Else, the user can just sign up again which results in the confirmation email being resent. |
Beta Was this translation helpful? Give feedback.
-
I have another use case related to all this : I would like to signup users WITHOUT having to confirm their emails in the first place. Any idea how to work around this issue? |
Beta Was this translation helpful? Give feedback.
-
For everyone stumbling on this. I solved this (whithout using custom emails) by moving the signup logic completely on the server by using And regardless if this request was successful (user was not registered, now is registered) or if the request fails (because user already is registered), I always do a Be aware that this seems to only work on accounts that have not password set (oAuth/Magic Link). |
Beta Was this translation helpful? Give feedback.
-
I agree that this should be fixed. What I am doing to work around this problem is using |
Beta Was this translation helpful? Give feedback.
-
This was pretty confusing for us, but our findings show that if you call signUpWithOtp https://supabase.com/docs/reference/javascript/auth-signinwithotp this does the email confirmation if they are not confirmed. |
Beta Was this translation helpful? Give feedback.
-
the required gotrue feature pr was merged last week into gotrue-js. see: supabase/auth-js#631 |
Beta Was this translation helpful? Give feedback.
-
you can now use
it looks like to send a signup email. docs: https://supabase.com/docs/reference/javascript/auth-resend |
Beta Was this translation helpful? Give feedback.
-
hi everyone, this is now possible by doing |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, just wondering if would it be possible to generate a resend confirmation email link without the password? something like below:
thanks! |
Beta Was this translation helpful? Give feedback.
-
I have written the following code in my server actions file for resending the confirmation email: 'use server'
import { createServiceRoleClient } from '@/utils/supabase/server'
export const verifyEmail = async (email: string) => {
const supabase = createServiceRoleClient()
const response = await supabase.auth.resend({
type: 'signup',
email,
options: {
emailRedirectTo: `${process.env.NEXT_PUBLIC_APP_URL}/auth/callback?next=/dashboard`
}
})
console.log(response)
return response
} When I log the response, I keep seeing this in my terminal:
I'm stuck and can't figure out where I'm going wrong. Any guidance would be amazing! 🙏 Thanks in advance! |
Beta Was this translation helpful? Give feedback.
hi everyone, this is now possible by doing
supabase.auth.resend(...)
- check it out here: https://supabase.com/docs/reference/javascript/auth-resend