[PR #7209] [MERGED] feat(db): add verification identifier storage options #32747

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7209
Author: @Paola3stefania
Created: 1/8/2026
Status: Merged
Merged: 1/27/2026
Merged by: @himself65

Base: canaryHead: feat/verification-token-storage


📝 Commits (10+)

  • 8e5bfa1 feat add StoreIdentifierOption
  • 0e8b135 feat: add verification config
  • 2df6027 feat: added tolen utility functions
  • 5fe2f0c types
  • b935664 feat: oken storage in verification adapter
  • a96f6b0 feat: test
  • 8446c21 make lint happy
  • 7a55177 lint happy
  • f46f68e Merge branch 'canary' into feat/verification-token-storage
  • df965b0 fix: expand storeIdentifier

📊 Changes

8 files changed (+607 additions, -100 deletions)

View changed files

📝 packages/better-auth/src/db/internal-adapter.test.ts (+316 -1)
📝 packages/better-auth/src/db/internal-adapter.ts (+128 -45)
packages/better-auth/src/db/verification-token-storage.ts (+54 -0)
📝 packages/better-auth/src/types/index.ts (+1 -0)
📝 packages/core/src/db/get-tables.ts (+43 -37)
📝 packages/core/src/db/test/get-tables.test.ts (+33 -0)
📝 packages/core/src/types/index.ts (+1 -0)
📝 packages/core/src/types/init-options.ts (+31 -17)

📄 Description

Summary by cubic

Adds configurable storage for verification identifiers with plain, hashed, or custom hashing, plus per-prefix overrides. Integrates secondary storage for verification tokens with TTLs, optional DB persistence, and fallback lookup for older plain tokens.

  • New Features
    • StoreIdentifierOption supports plain, hashed, or custom hash, with per-prefix overrides via verification.storeIdentifier.
    • Secondary storage for verification: store/find/delete by processed identifier with TTL from expiresAt, plus plain fallback for legacy tokens.
    • verification.storeInDatabase keeps DB rows when secondaryStorage is used; getAuthTables includes the verification table only when enabled.

Written for commit 88f71b6bc5. 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/7209 **Author:** [@Paola3stefania](https://github.com/Paola3stefania) **Created:** 1/8/2026 **Status:** ✅ Merged **Merged:** 1/27/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/verification-token-storage` --- ### 📝 Commits (10+) - [`8e5bfa1`](https://github.com/better-auth/better-auth/commit/8e5bfa140cbe6341a465cfbbfcfe8de9ac82272d) feat add StoreIdentifierOption - [`0e8b135`](https://github.com/better-auth/better-auth/commit/0e8b1351df89f52dc0403c361941c05f23004108) feat: add verification config - [`2df6027`](https://github.com/better-auth/better-auth/commit/2df602755814e5cffa09a75a0faeded2f4e2551e) feat: added tolen utility functions - [`5fe2f0c`](https://github.com/better-auth/better-auth/commit/5fe2f0c81d387779e0fc74cc318083d468511508) types - [`b935664`](https://github.com/better-auth/better-auth/commit/b935664e2e7b7a2574a9606e58c4b3714a9d2a52) feat: oken storage in verification adapter - [`a96f6b0`](https://github.com/better-auth/better-auth/commit/a96f6b05b4a2b976d766670b318f4ae907abbd14) feat: test - [`8446c21`](https://github.com/better-auth/better-auth/commit/8446c2195bbd21e7ccd6a20de9d2694fc723db8e) make lint happy - [`7a55177`](https://github.com/better-auth/better-auth/commit/7a551770704857c416ca1e63e804e36d8144d907) lint happy - [`f46f68e`](https://github.com/better-auth/better-auth/commit/f46f68e1dabd7d8231d7e39d5877931a0783ce43) Merge branch 'canary' into feat/verification-token-storage - [`df965b0`](https://github.com/better-auth/better-auth/commit/df965b01a916ae252f8fc3135d23a0ce5f8b3ba8) fix: expand storeIdentifier ### 📊 Changes **8 files changed** (+607 additions, -100 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/internal-adapter.test.ts` (+316 -1) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+128 -45) ➕ `packages/better-auth/src/db/verification-token-storage.ts` (+54 -0) 📝 `packages/better-auth/src/types/index.ts` (+1 -0) 📝 `packages/core/src/db/get-tables.ts` (+43 -37) 📝 `packages/core/src/db/test/get-tables.test.ts` (+33 -0) 📝 `packages/core/src/types/index.ts` (+1 -0) 📝 `packages/core/src/types/init-options.ts` (+31 -17) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds configurable storage for verification identifiers with plain, hashed, or custom hashing, plus per-prefix overrides. Integrates secondary storage for verification tokens with TTLs, optional DB persistence, and fallback lookup for older plain tokens. - **New Features** - StoreIdentifierOption supports plain, hashed, or custom hash, with per-prefix overrides via verification.storeIdentifier. - Secondary storage for verification: store/find/delete by processed identifier with TTL from expiresAt, plus plain fallback for legacy tokens. - verification.storeInDatabase keeps DB rows when secondaryStorage is used; getAuthTables includes the verification table only when enabled. <sup>Written for commit 88f71b6bc5e99e0def6e5e616d15b2131b7f95d7. 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:29:35 -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#32747