Does the phoneNumber plugin recognize manually created users?
When using the
better-auth with phoneNumber plugin, if I create a user directly in the database with a phoneNumber, will an API call like authClient.phoneNumber.sendOtp and authClient.phoneNumber.verify for that number recognize the existing user, or will it create a new one?4 Replies
@admin Could you guys please take a look?
I don't think sendOtp will check, but the
verify will simply change phoneNumberVerified to true and shouldn't create a new user.phoneNumber plugin requires
getTempEmail function if allow signup on verification.
Does it rely on email to determine if the user exists before creating a new one?
If yes, that means a manually created user without an email (although having phoneNumber and phoneNumberVerified) will not be considered an existing user, and the verify function will create a new one?Solution
I'm pretty sure it finds the user based on the phone number