Supabase Register with Email OTP Verification
Good day, I have an Expo React Native mobile app that uses Supabase for the Auth and Database. I wish to make my register to have two steps, first fills the registration form and then redirect to the verify OTP page where I can fill the OTP numbers.
However, I can't find any guideline for Supabase to register with Email OTP verification, all it uses was login with email OTP only or magic link the passwordless auth. All I found is that the Supabase email OTP only works to sign in not for sign up. I'm aware that supabase has email confirmation link but I was hoping I can use the verify OTP instead.
Here's the progress I have encounter so far:
- I have asked A.I how to implement Register with email OTP verification, some A.I did mentions I required to turn on the enabled phone provider for the OTP registration. Is this true tho? Why would I need phone provider for the auth, while I'm using the email provider.
- Whenever I try to test the register, just before verifying the OTP the user registration already created at Supabase Auth. Even when I'm already using the await, it just won't work or I still need to modify my code. But this problem make me thinks it just not possible to register with OTP.
I was hoping the professional here has my answer, thank you everyone for having the time to read my question!
9 Replies
@dev_edbert supabase doesn’t support email OTP for sign-up it only works for login. For registration, you must use the email confirmation link or build a custom OTP flow yourself.
The OTP is used for both sign in and sign ups, you just use
signInWithOtp
and it will send an email for signing up. The default template however doesn't contain the 6 digit OTP code, you have to add it using the {{ .Token }}
variable in the email template.But how do I prevent it didnt register the user to my supabase auth before the user verify the OTP correctly
Like just after redirect to the verify OTP, I refresh the auth and the user already registered before I enter the OTP
How would it know who to verify if they aren’t registered?
Likely your email link is verifying the account. If you want to do it manually then you should setup the url you want the user to go to inside of your email template
Hmm.. gor the OTP I actually already turn off the confirm email sign up,,
Thats the question, I already set it await.. hm maybe I need to work on the logic
Wait let me share my repo
Here's how I handle the register:
And here's how I verify the OTP:
But the official docs did show that there is type 'signup' for the verifyOtp method with email
@OakRatos its at here, https://supabase.com/docs/reference/javascript/auth-resetpasswordforemail
JavaScript: Send a password reset request | Supabase Docs
Supabase API reference for JavaScript: Send a password reset request

But what does the
invite
email content look like?oh this one is for my affiliate system
I’m talking about the content of the email template in the Supabase dashboard. Please show what that looks like.