[PR #8477] [MERGED] docs(2fa): fix OTP server API method names #24901

Closed
opened 2026-04-15 22:37:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8477
Author: @GautamBytes
Created: 3/7/2026
Status: Merged
Merged: 3/7/2026
Merged by: @Bekacru

Base: canaryHead: fix/2fa-otp-docs


📝 Commits (3)

  • 3f335ab docs: fix 2FA OTP API names
  • fe992f3 docs: clarify 2FA client API usage
  • 9b34945 docs: add 2FA header guidance

📊 Changes

3 files changed (+60 additions, -11 deletions)

View changed files

📝 docs/content/docs/plugins/2fa.mdx (+35 -9)
📝 landing/components/api-method.tsx (+23 -0)
📝 packages/better-auth/src/plugins/two-factor/otp/index.ts (+2 -2)

📄 Description

Summary

Fixes #8473

  • fix the 2FA OTP docs to use the actual public server API names
  • align the OTP endpoint JSDoc with the exported auth.api surface
  • keep internal helper names unchanged to avoid unnecessary runtime churn

Details

The 2FA OTP plugin already exposes:

  • auth.api.sendTwoFactorOTP
  • auth.api.verifyTwoFactorOTP

The docs page and the inline OTP endpoint JSDoc were still referring to:

  • auth.api.send2FaOTP
  • auth.api.verifyOTP

This PR updates both documentation sources so they match the real public API.


Summary by cubic

Fix 2FA OTP docs/JSDoc to use correct API names, clarify client usage, and show header forwarding for server calls; adds APIMethod requireHeaders. Replace send2FaOTP/verifyOTP with auth.api.sendTwoFactorOTP/auth.api.verifyTwoFactorOTP and authClient.twoFactor.sendOtp/verifyOtp; no runtime changes (fixes #8473).

Written for commit 9b349455e4. 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/8477 **Author:** [@GautamBytes](https://github.com/GautamBytes) **Created:** 3/7/2026 **Status:** ✅ Merged **Merged:** 3/7/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/2fa-otp-docs` --- ### 📝 Commits (3) - [`3f335ab`](https://github.com/better-auth/better-auth/commit/3f335ab5a0ff91092da9c978bd9329fa12d8bb0b) docs: fix 2FA OTP API names - [`fe992f3`](https://github.com/better-auth/better-auth/commit/fe992f31dcb47be0e724884c5696573f9924f223) docs: clarify 2FA client API usage - [`9b34945`](https://github.com/better-auth/better-auth/commit/9b349455e47ab3083b5f05bd4252cb4890b0ecdf) docs: add 2FA header guidance ### 📊 Changes **3 files changed** (+60 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/2fa.mdx` (+35 -9) 📝 `landing/components/api-method.tsx` (+23 -0) 📝 `packages/better-auth/src/plugins/two-factor/otp/index.ts` (+2 -2) </details> ### 📄 Description ## Summary Fixes #8473 - fix the 2FA OTP docs to use the actual public server API names - align the OTP endpoint JSDoc with the exported `auth.api` surface - keep internal helper names unchanged to avoid unnecessary runtime churn ## Details The 2FA OTP plugin already exposes: - `auth.api.sendTwoFactorOTP` - `auth.api.verifyTwoFactorOTP` The docs page and the inline OTP endpoint JSDoc were still referring to: - `auth.api.send2FaOTP` - `auth.api.verifyOTP` This PR updates both documentation sources so they match the real public API. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix 2FA OTP docs/JSDoc to use correct API names, clarify client usage, and show header forwarding for server calls; adds APIMethod requireHeaders. Replace send2FaOTP/verifyOTP with auth.api.sendTwoFactorOTP/auth.api.verifyTwoFactorOTP and authClient.twoFactor.sendOtp/verifyOtp; no runtime changes (fixes #8473). <sup>Written for commit 9b349455e47ab3083b5f05bd4252cb4890b0ecdf. 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-15 22:37:19 -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#24901