How to implement passwordless login with phone number OTP in Better-Auth
Hi everyone, this is my first time of using better-auth
I’m trying to implement passwordless login using phone numbers and OTP in Better-Auth. I have:
I suspect I’m missing a step. What is the correct flow for logging in users via phone number OTP? Do I need to create a user first, or is there a way to let Better-Auth handle it automatically?
Thanks in advance!
I’m trying to implement passwordless login using phone numbers and OTP in Better-Auth. I have:
- Enabled the phoneNumber plugin.
- Sent a request to
/phone-number/send-otpto get the OTP. - Verified the OTP via
/phone-number/verify.
I suspect I’m missing a step. What is the correct flow for logging in users via phone number OTP? Do I need to create a user first, or is there a way to let Better-Auth handle it automatically?
Thanks in advance!