[PR #7971] [MERGED] fix(email-otp): avoid user enumeration when disabled sign-up #33261

Closed
opened 2026-04-17 23:54:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7971
Author: @jslno
Created: 2/14/2026
Status: Merged
Merged: 2/15/2026
Merged by: @Bekacru

Base: canaryHead: 02-14-2026/email-otp-disabled-signin-error


📝 Commits (1)

  • e2abc2d fix(email-otp): throw INVALID_OTP instead of USER_NOT_FOUND

📊 Changes

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

View changed files

📝 packages/better-auth/src/plugins/email-otp/routes.ts (+1 -1)

📄 Description

closes #7944


Summary by cubic

When sign-up is disabled, email OTP sign-in now returns INVALID_OTP instead of USER_NOT_FOUND. This prevents leaking whether an email exists and standardizes the error response.

Written for commit e2abc2d197. Summary will update on new commits.


🔄 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/7971 **Author:** [@jslno](https://github.com/jslno) **Created:** 2/14/2026 **Status:** ✅ Merged **Merged:** 2/15/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `02-14-2026/email-otp-disabled-signin-error` --- ### 📝 Commits (1) - [`e2abc2d`](https://github.com/better-auth/better-auth/commit/e2abc2d1972eb58966a98c96cfa0e581bc791032) fix(email-otp): throw `INVALID_OTP` instead of `USER_NOT_FOUND` ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/email-otp/routes.ts` (+1 -1) </details> ### 📄 Description closes #7944 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic When sign-up is disabled, email OTP sign-in now returns INVALID_OTP instead of USER_NOT_FOUND. This prevents leaking whether an email exists and standardizes the error response. <sup>Written for commit e2abc2d1972eb58966a98c96cfa0e581bc791032. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <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-04-17 23:54:28 -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#33261