[PR #845] [MERGED] fix: email OTP error codes and docs #3506

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/845
Author: @jasongerbes
Created: 12/10/2024
Status: Merged
Merged: 12/11/2024
Merged by: @Bekacru

Base: mainHead: fix/email-otp-error-codes


📝 Commits (1)

  • 9a03f34 fix: email OTP error codes and docs

📊 Changes

3 files changed (+67 additions, -45 deletions)

View changed files

📝 docs/content/docs/guides/your-first-plugin.mdx (+6 -2)
📝 docs/content/docs/plugins/email-otp.mdx (+25 -12)
📝 packages/better-auth/src/plugins/email-otp/index.ts (+36 -31)

📄 Description

This PR includes improvements for the Email OTP plugin:

  • Consistently return errors with values from ERROR_CODES.
  • Consistently return OTP_EXPIRED when the OTP has expired.
  • Add details about password reset via OTP to docs.

It also includes a fix for the 'your first plugin' guide (throw APIError -> throw new APIError).


🔄 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/845 **Author:** [@jasongerbes](https://github.com/jasongerbes) **Created:** 12/10/2024 **Status:** ✅ Merged **Merged:** 12/11/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/email-otp-error-codes` --- ### 📝 Commits (1) - [`9a03f34`](https://github.com/better-auth/better-auth/commit/9a03f346b44d74e0acf91a3ee24b883b5df5bd38) fix: email OTP error codes and docs ### 📊 Changes **3 files changed** (+67 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/guides/your-first-plugin.mdx` (+6 -2) 📝 `docs/content/docs/plugins/email-otp.mdx` (+25 -12) 📝 `packages/better-auth/src/plugins/email-otp/index.ts` (+36 -31) </details> ### 📄 Description This PR includes improvements for the Email OTP plugin: - Consistently return errors with values from `ERROR_CODES`. - Consistently return `OTP_EXPIRED` when the OTP has expired. - Add details about password reset via OTP to docs. It also includes a fix for the 'your first plugin' guide (`throw APIError` -> `throw new APIError`). --- <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 10:56: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#3506