[GH-ISSUE #86] verifyOTP api #25442

Closed
opened 2026-04-17 15:39:11 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @amirhd-com on GitHub (Oct 4, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/86

when I use phoneNumber.verify like this:

image

with this config on auth.ts:

image

I get just this error on console:

image

while the better auth installation and database seems fine. the phoneNumber.sendVerificationCode is work good and I check database that save the phone number and the code successfully. but when I verify the code get the error at all.

  • when I check verfication table and exiresAt column forexample for latest code, the time that saved by UTC, even my users in other region have time difference. when I edit time directly on database based on my region zone and then request to verify code, still get the error again *
Originally created by @amirhd-com on GitHub (Oct 4, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/86 **when I use phoneNumber.verify like this:** ![image](https://github.com/user-attachments/assets/8e666b57-361f-4b4f-9aae-fc588fc4c057) **with this config on auth.ts:** ![image](https://github.com/user-attachments/assets/2ccd5405-9b3d-410e-a509-1a922ff11ae9) ### I get just this error on console: ![image](https://github.com/user-attachments/assets/d0d83fd7-9f0b-46c4-ad7f-a2e1dc123e7c) while the better auth installation and database seems fine. the phoneNumber.sendVerificationCode is work good and I check database that save the phone number and the code successfully. but when I verify the code get the error at all. * when I check verfication table and exiresAt column forexample for latest code, the time that saved by UTC, even my users in other region have time difference. when I edit time directly on database based on my region zone and then request to verify code, still get the error again *
GiteaMirror added the locked label 2026-04-17 15:39:11 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 5, 2024):

You shouldn't pass verifyOTP, as the plugin automatically handles OTP verification. That was an undocumented API that doesn't work. Please update to the latest version and let me know if the issue persists.

<!-- gh-comment-id:2395170992 --> @Bekacru commented on GitHub (Oct 5, 2024): You shouldn't pass verifyOTP, as the plugin automatically handles OTP verification. That was an undocumented API that doesn't work. Please update to the latest version and let me know if the issue persists.
Author
Owner

@amirhd-com commented on GitHub (Oct 5, 2024):

You shouldn't pass verifyOTP, as the plugin automatically handles OTP verification. That was an undocumented API that doesn't work. Please update to the latest version and let me know if the issue persists.

Ok, I removed verifyOTP and config all require things again depend on lastest version, but still get 404 status and invalid code per request to phoneNumber.verify...

<!-- gh-comment-id:2395209267 --> @amirhd-com commented on GitHub (Oct 5, 2024): > You shouldn't pass verifyOTP, as the plugin automatically handles OTP verification. That was an undocumented API that doesn't work. Please update to the latest version and let me know if the issue persists. Ok, I removed verifyOTP and config all require things again depend on lastest version, but still get 404 status and invalid code per request to phoneNumber.verify...
Author
Owner

@Bekacru commented on GitHub (Oct 6, 2024):

Could you please share me a reproduction? All of our tests are passing, so I'm not sure what's causing the issue on your end.

<!-- gh-comment-id:2395293509 --> @Bekacru commented on GitHub (Oct 6, 2024): Could you please share me a reproduction? All of our tests are passing, so I'm not sure what's causing the issue on your end.
Author
Owner

@amirhd-com commented on GitHub (Oct 7, 2024):

I solved it by install better fetch library...

npm i @better-fetch/fetch

<!-- gh-comment-id:2396618288 --> @amirhd-com commented on GitHub (Oct 7, 2024): I solved it by install better fetch library... ### npm i @better-fetch/fetch
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25442