[PR #7789] [CLOSED] Add allowedAttempts setting #24455

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7789
Author: @vadim-works
Created: 2/4/2026
Status: Closed

Base: canaryHead: feat/issue-1-add-allowed-attempts


📝 Commits (1)

📊 Changes

3 files changed (+294 additions, -5 deletions)

View changed files

📝 docs/content/docs/plugins/magic-link.mdx (+2 -0)
📝 packages/better-auth/src/plugins/magic-link/index.ts (+31 -4)
📝 packages/better-auth/src/plugins/magic-link/magic-link.test.ts (+261 -1)

📄 Description

Close #1


Summary by cubic

Add an allowedAttempts setting to the Magic Link plugin to control how many times a token can be verified. Default is 1; exceeding the limit deletes the token and redirects with ?error=ATTEMPTS_EXCEEDED.

  • New Features
    • Added allowedAttempts option (default 1; supports Infinity for unlimited), with attempt count stored and incremented per verify.
    • Verification blocks and deletes the token when the limit is reached; existing expiry checks still apply.
    • Updated docs and added tests for default, custom values (e.g., 3), Infinity, and expired tokens.

Written for commit fb2ec774e5. 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/7789 **Author:** [@vadim-works](https://github.com/vadim-works) **Created:** 2/4/2026 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/issue-1-add-allowed-attempts` --- ### 📝 Commits (1) - [`fb2ec77`](https://github.com/better-auth/better-auth/commit/fb2ec774e5ee4a288355249be0f8d6659545cb76) Add allowedAttempts setting #1 ### 📊 Changes **3 files changed** (+294 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/magic-link.mdx` (+2 -0) 📝 `packages/better-auth/src/plugins/magic-link/index.ts` (+31 -4) 📝 `packages/better-auth/src/plugins/magic-link/magic-link.test.ts` (+261 -1) </details> ### 📄 Description Close #1 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add an allowedAttempts setting to the Magic Link plugin to control how many times a token can be verified. Default is 1; exceeding the limit deletes the token and redirects with ?error=ATTEMPTS_EXCEEDED. - **New Features** - Added allowedAttempts option (default 1; supports Infinity for unlimited), with attempt count stored and incremented per verify. - Verification blocks and deletes the token when the limit is reached; existing expiry checks still apply. - Updated docs and added tests for default, custom values (e.g., 3), Infinity, and expired tokens. <sup>Written for commit fb2ec774e5ee4a288355249be0f8d6659545cb76. 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:22:43 -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#24455