[PR #2234] [MERGED] feat(two-factor): refactor two-factor authentication with better error handling, configurable otp limits and verification #4218

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2234
Author: @Bekacru
Created: 4/12/2025
Status: Merged
Merged: 4/12/2025
Merged by: @Bekacru

Base: mainHead: refactor/two-factor


📝 Commits (2)

  • 2279a2b feat(two-factor): refactor two-factor authentication with better error handling, configurable otp limits and verification
  • 65ed435 address review comments

📊 Changes

9 files changed (+306 additions, -212 deletions)

View changed files

📝 packages/better-auth/src/db/schema.ts (+0 -1)
📝 packages/better-auth/src/plugins/two-factor/backup-codes/index.ts (+14 -10)
📝 packages/better-auth/src/plugins/two-factor/error-code.ts (+4 -0)
📝 packages/better-auth/src/plugins/two-factor/index.ts (+9 -8)
📝 packages/better-auth/src/plugins/two-factor/otp/index.ts (+63 -20)
📝 packages/better-auth/src/plugins/two-factor/totp/index.ts (+20 -31)
📝 packages/better-auth/src/plugins/two-factor/two-factor.test.ts (+60 -2)
packages/better-auth/src/plugins/two-factor/verify-middleware.ts (+0 -140)
packages/better-auth/src/plugins/two-factor/verify-two-factor.ts (+136 -0)

📄 Description

No description provided


🔄 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/2234 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 4/12/2025 **Status:** ✅ Merged **Merged:** 4/12/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `refactor/two-factor` --- ### 📝 Commits (2) - [`2279a2b`](https://github.com/better-auth/better-auth/commit/2279a2b8ea8358935a1b6651e94ffe466e4bac60) feat(two-factor): refactor two-factor authentication with better error handling, configurable otp limits and verification - [`65ed435`](https://github.com/better-auth/better-auth/commit/65ed435a4a01b5b6656daaab78d833297897ec1d) address review comments ### 📊 Changes **9 files changed** (+306 additions, -212 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/schema.ts` (+0 -1) 📝 `packages/better-auth/src/plugins/two-factor/backup-codes/index.ts` (+14 -10) 📝 `packages/better-auth/src/plugins/two-factor/error-code.ts` (+4 -0) 📝 `packages/better-auth/src/plugins/two-factor/index.ts` (+9 -8) 📝 `packages/better-auth/src/plugins/two-factor/otp/index.ts` (+63 -20) 📝 `packages/better-auth/src/plugins/two-factor/totp/index.ts` (+20 -31) 📝 `packages/better-auth/src/plugins/two-factor/two-factor.test.ts` (+60 -2) ➖ `packages/better-auth/src/plugins/two-factor/verify-middleware.ts` (+0 -140) ➕ `packages/better-auth/src/plugins/two-factor/verify-two-factor.ts` (+136 -0) </details> ### 📄 Description _No description provided_ --- <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:38:07 -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#4218