[PR #1617] [CLOSED] [ Plugin ] - Phone OTP - Add a return to sendOTP to prevent OTP generation #3898

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1617
Author: @AlexeyZoz
Created: 3/2/2025
Status: Closed

Base: mainHead: main


📝 Commits (7)

  • 9bba569 Gives the ability to block OTP generation via sendOTP opt
  • e645ba5 Gives the ability to block OTP generation via sendOTP opt
  • a6c4f60 Gives the ability to block OTP generation via sendOTP opt
  • 84e6c39 Gives the ability to block OTP generation via sendOTP opt
  • 634f42e Gives the ability to block OTP generation via sendOTP opt
  • 051930f Gives the ability to block OTP generation via sendOTP opt
  • a007daf Gives the ability to block OTP generation via sendOTP opt

📊 Changes

1 file changed (+22 additions, -7 deletions)

View changed files

📝 packages/better-auth/src/plugins/phone-number/index.ts (+22 -7)

📄 Description

When using sendOTP in the auth.ts file theres cases where generating an OTP would be useless and even harmful.

My Case:
In the sendOTP function i check if theres a registered user with the provided phone number.
I want to axe the process of OTP generation since its pointless and makes unnecessary DB actions.

Thank you for considering,
I believe it would be a blessed addition.
If you like idea but not the implementation feel free you inform me what to change.


🔄 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/1617 **Author:** [@AlexeyZoz](https://github.com/AlexeyZoz) **Created:** 3/2/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (7) - [`9bba569`](https://github.com/better-auth/better-auth/commit/9bba5692d155e01fde78889ab715deeef860754b) Gives the ability to block OTP generation via sendOTP opt - [`e645ba5`](https://github.com/better-auth/better-auth/commit/e645ba5bcf3e477fec07dbbadd3c443d0b0dd3d0) Gives the ability to block OTP generation via sendOTP opt - [`a6c4f60`](https://github.com/better-auth/better-auth/commit/a6c4f60fb3927a326d52f35f0662a59d4fd09702) Gives the ability to block OTP generation via sendOTP opt - [`84e6c39`](https://github.com/better-auth/better-auth/commit/84e6c39c2fdea4b190fdcd14bbb9dd3301f44317) Gives the ability to block OTP generation via sendOTP opt - [`634f42e`](https://github.com/better-auth/better-auth/commit/634f42e9f78a40fdaadd34aba83d49bdc2c40398) Gives the ability to block OTP generation via sendOTP opt - [`051930f`](https://github.com/better-auth/better-auth/commit/051930f984a898bcc0d6c409c69b5310cbf61acf) Gives the ability to block OTP generation via sendOTP opt - [`a007daf`](https://github.com/better-auth/better-auth/commit/a007dafbeaa9e8ab69ceaddc4ab6e3ef78f7e591) Gives the ability to block OTP generation via sendOTP opt ### 📊 Changes **1 file changed** (+22 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/phone-number/index.ts` (+22 -7) </details> ### 📄 Description When using `sendOTP` in the `auth.ts` file theres cases where generating an OTP would be useless and even harmful. My Case: In the `sendOTP` function i check if theres a registered user with the provided phone number. I want to axe the process of OTP generation since its pointless and makes unnecessary DB actions. Thank you for considering, I believe it would be a blessed addition. If you like idea but not the implementation feel free you inform me what to change. --- <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:20:57 -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#3898