[PR #1576] [CLOSED] fix(phone-number): implement verifyOTP override #3873

Closed
opened 2026-03-13 11:19:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1576
Author: @zain
Created: 2/26/2025
Status: Closed

Base: canaryHead: fix/phone-number-verifyOTP-impl


📝 Commits (3)

  • 38ee739 fix(phone-number): implement verifyOTP override
  • e6bcd72 add namespace for fix
  • 808cc2c Revert "add namespace for fix"

📊 Changes

2 files changed (+107 additions, -14 deletions)

View changed files

📝 packages/better-auth/src/plugins/phone-number/index.ts (+41 -14)
📝 packages/better-auth/src/plugins/phone-number/phone-number.test.ts (+66 -0)

📄 Description

The phone number plugin docs say this:

Options
...
verifyOTP: A custom function to verify the OTP code. It takes the phone number and the OTP code as arguments and returns a boolean indicating whether the code is valid.

This is actually untrue though and is not implemented. This PR adds an implementation for this.

Fixes #1159


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/1576 **Author:** [@zain](https://github.com/zain) **Created:** 2/26/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/phone-number-verifyOTP-impl` --- ### 📝 Commits (3) - [`38ee739`](https://github.com/better-auth/better-auth/commit/38ee7393061792cd0f8e3ff8f309de462028e2cd) fix(phone-number): implement verifyOTP override - [`e6bcd72`](https://github.com/better-auth/better-auth/commit/e6bcd72076b9ea9a9c2d032d9db150569b902012) add namespace for fix - [`808cc2c`](https://github.com/better-auth/better-auth/commit/808cc2cb8c7eea0611a7731a11ac87c1ef27fb33) Revert "add namespace for fix" ### 📊 Changes **2 files changed** (+107 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/phone-number/index.ts` (+41 -14) 📝 `packages/better-auth/src/plugins/phone-number/phone-number.test.ts` (+66 -0) </details> ### 📄 Description The [phone number plugin](https://www.better-auth.com/docs/plugins/phone-number) docs say this: > Options > ... > verifyOTP: A custom function to verify the OTP code. It takes the phone number and the OTP code as arguments and returns a boolean indicating whether the code is valid. This is actually untrue though and is not implemented. This PR adds an implementation for this. Fixes #1159 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 11:19:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#3873