Phone number sign up doesn’t create a record in the Account table?
Hello I want to use better-auth for my nextjs app with phone numbers only authentication. sign up is fine but login complains that there’s no credential account found.
This is my code for sign up right now that works correctly:
await authClient.signUp.email({
name:
await authClient.phoneNumber.sendOtp({ phoneNumber: values.phoneNumber, });
User${values.phoneNumber}
,
email: ${values.phoneNumber}@my-site.com
,
password: values.password,
});
await authClient.signIn.email({
email: ${values.phoneNumber}@my-site.com
,
password: values.password,
});
await authClient.phoneNumber.sendOtp({ phoneNumber: values.phoneNumber, });
1 Reply
I have followed the official docs where I add code to give a temporary email in signupOnVerification but that’s the issue I can’t just use sendOtp to create an account for a user or rather it doesn’t create a record in the account table which is what using phone numbers sign in will look for hence throwing an error.