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?
Solution:
I'm pretty sure it finds the user based on the phone number
Jump to solution
4 Replies
BNFFALO
BNFFALOOP2mo ago
@admin Could you guys please take a look?
Ping
Ping2mo ago
I don't think sendOtp will check, but the verify will simply change phoneNumberVerified to true and shouldn't create a new user.
BNFFALO
BNFFALOOP2mo ago
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
Ping
Ping2mo ago
I'm pretty sure it finds the user based on the phone number

Did you find this page helpful?