[GH-ISSUE #4468] email verification are not using secondaryStorage #18576

Closed
opened 2026-04-15 17:04:55 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @proof-llc on GitHub (Sep 5, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4468

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. configure secondarystorage
  2. kick off email verification

Current vs. Expected behavior

the job of the secondaryStorage is to help with ephemeral information. email verification fits that bill and upon reading the documentation, i would have expected it to be stored there. instead the info is stored in primary storage.

What version of Better Auth are you using?

1.3.8

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025;",
    "release": "24.6.0",
    "cpuCount": 16,
    "cpuModel": "redacted",
    "totalMemory": "128.00 GB",
    "freeMemory": "20.62 GB"
  },
  "node": {
    "version": "v24.7.0",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "11.5.1"
  },
  "frameworks": null,
  "databases": null,
  "betterAuth": {
    "version": "0.1.0",
    "config": null
  }
}

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @proof-llc on GitHub (Sep 5, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4468 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce 1. configure secondarystorage 2. kick off email verification ### Current vs. Expected behavior the job of the secondaryStorage is to help with ephemeral information. email verification fits that bill and upon reading the documentation, i would have expected it to be stored there. instead the info is stored in primary storage. ### What version of Better Auth are you using? 1.3.8 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025;", "release": "24.6.0", "cpuCount": 16, "cpuModel": "redacted", "totalMemory": "128.00 GB", "freeMemory": "20.62 GB" }, "node": { "version": "v24.7.0", "env": "development" }, "packageManager": { "name": "npm", "version": "11.5.1" }, "frameworks": null, "databases": null, "betterAuth": { "version": "0.1.0", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the lockedenhancement labels 2026-04-15 17:04:55 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 5, 2025):

Hi @proof-llc! I'm Dosu and I’m helping the better-auth team.

Email verification and OTP data in Better Auth 1.3.8 are stored in primary storage via the internalAdapter, not in secondaryStorage. While secondaryStorage is used for ephemeral data like sessions and rate limiting, there is no current support or configuration to store email verification data there. This is by design, and the documentation does not mention secondaryStorage as an option for email verification. Supporting this would require a code change or feature addition (source).

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

<!-- gh-comment-id:3258935349 --> @dosubot[bot] commented on GitHub (Sep 5, 2025): <!-- Greeting --> Hi @proof-llc! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> Email verification and OTP data in Better Auth 1.3.8 are stored in primary storage via the internalAdapter, not in secondaryStorage. While secondaryStorage is used for ephemeral data like sessions and rate limiting, there is no current support or configuration to store email verification data there. This is by design, and the documentation does not mention secondaryStorage as an option for email verification. Supporting this would require a code change or feature addition ([source](https://github.com/better-auth/better-auth/pull/1149)). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/3a373042-5cb6-4ec7-97a2-fa95749dbb49?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3a373042-5cb6-4ec7-97a2-fa95749dbb49?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3a373042-5cb6-4ec7-97a2-fa95749dbb49?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3a373042-5cb6-4ec7-97a2-fa95749dbb49?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3a373042-5cb6-4ec7-97a2-fa95749dbb49?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3a373042-5cb6-4ec7-97a2-fa95749dbb49?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3a373042-5cb6-4ec7-97a2-fa95749dbb49?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/4468)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18576