[GH-ISSUE #3701] Confusing duplication in config #27015

Closed
opened 2026-04-17 17:48:10 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @issam-seghir on GitHub (Jul 30, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3701

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

In the auth config, there are two similar configurations: verifications and verificationTokens. They both seem to share the same options, except that verificationTokens includes an additional field: expiresIn.

Similarly, there are both accounts (plural) and account configs , and it's unclear what the difference is.
This is quite confusing.

Which one should we use?
Do they serve the same purpose, or are they intended for different use cases?

Current vs. Expected behavior

..

What version of Better Auth are you using?

1.3.4

Provide environment information

OS : windows 10
browser : chrome

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

Client, Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
 database: prismaAdapter(prisma, {
        provider: "postgresql",
        debugLogs: isDev,
    }),
    accounts: {
        modelName: "accounts",
        fields: {
            accountId: "providerAccountId", // to help better auth migration from next-auth
            providerId: "provider",
            accessToken: "access_token", 
            refreshToken: "refresh_token", 
            accessTokenExpiresAt: "accessTokenExpiresAt",
            refreshTokenExpiresAt: "refreshTokenExpiresAt", 
            idToken: "id_token", 
        },
        accountLinking: {
            enabled: true,
            trustedProviders: ["google", "email-password"],
        },
    },
    verificationTokens: {
        modelName: "verification_tokens", 
        fields: {
            value: "token", // to help better auth migration from next-auth
            expiresAt: "expires", 
        },
        disableCleanup: false,
        expiresIn: ms("1h") / 1000, // 1 hour
    },
});

Additional context

No response

Originally created by @issam-seghir on GitHub (Jul 30, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3701 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce In the auth config, there are two similar configurations: `verifications `and `verificationTokens`. They both seem to share the same options, except that `verificationTokens` includes an additional field: `expiresIn`. Similarly, there are both `accounts` (plural) and `account` configs , and it's unclear what the difference is. This is quite confusing. Which one should we use? Do they serve the same purpose, or are they intended for different use cases? ### Current vs. Expected behavior .. ### What version of Better Auth are you using? 1.3.4 ### Provide environment information ```bash OS : windows 10 browser : chrome ``` ### Which area(s) are affected? (Select all that apply) Client, Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ database: prismaAdapter(prisma, { provider: "postgresql", debugLogs: isDev, }), accounts: { modelName: "accounts", fields: { accountId: "providerAccountId", // to help better auth migration from next-auth providerId: "provider", accessToken: "access_token", refreshToken: "refresh_token", accessTokenExpiresAt: "accessTokenExpiresAt", refreshTokenExpiresAt: "refreshTokenExpiresAt", idToken: "id_token", }, accountLinking: { enabled: true, trustedProviders: ["google", "email-password"], }, }, verificationTokens: { modelName: "verification_tokens", fields: { value: "token", // to help better auth migration from next-auth expiresAt: "expires", }, disableCleanup: false, expiresIn: ms("1h") / 1000, // 1 hour }, }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-17 17:48:10 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 30, 2025):

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

Only the singular config options—account and verification—are supported and documented in Better Auth 1.3.4. These are used for customizing the account and verification models (like mapping fields or changing table names). There are no public config options called accounts, verifications, or verificationTokens—those do not appear in the type definitions or schema and are not part of the intended API.

If you want to control things like verification token expiry, use the emailVerification config, which includes options such as expiresIn for token lifetime. The plural forms and verificationTokens are likely a misunderstanding or legacy/unsupported usage and should be ignored or removed from your config. Stick to the singular, documented keys for reliable behavior.
Reference: BetterAuthOptions type definitions

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:3135775423 --> @dosubot[bot] commented on GitHub (Jul 30, 2025): <!-- Greeting --> Hi @issam-seghir! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> Only the singular config options—`account` and `verification`—are supported and documented in Better Auth 1.3.4. These are used for customizing the account and verification models (like mapping fields or changing table names). There are no public config options called `accounts`, `verifications`, or `verificationTokens`—those do not appear in the type definitions or schema and are not part of the intended API. If you want to control things like verification token expiry, use the `emailVerification` config, which includes options such as `expiresIn` for token lifetime. The plural forms and `verificationTokens` are likely a misunderstanding or legacy/unsupported usage and should be ignored or removed from your config. Stick to the singular, documented keys for reliable behavior. [Reference: BetterAuthOptions type definitions](https://github.com/better-auth/better-auth/blob/4ad0a419d370de69071acf176aeb18163349b728/packages/better-auth/src/types/options.ts) <!-- 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/125ca2a2-3d03-48c4-9372-53a7c1cbb6cd?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/125ca2a2-3d03-48c4-9372-53a7c1cbb6cd?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/125ca2a2-3d03-48c4-9372-53a7c1cbb6cd?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/125ca2a2-3d03-48c4-9372-53a7c1cbb6cd?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/125ca2a2-3d03-48c4-9372-53a7c1cbb6cd?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/125ca2a2-3d03-48c4-9372-53a7c1cbb6cd?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/125ca2a2-3d03-48c4-9372-53a7c1cbb6cd?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/3701)
Author
Owner

@Kinfe123 commented on GitHub (Jul 30, 2025):

there is no such thing referenced on our options. can you please check if there is any conflicts may be global override or merges.

<!-- gh-comment-id:3135882140 --> @Kinfe123 commented on GitHub (Jul 30, 2025): there is no such thing referenced on our options. can you please check if there is any conflicts may be global override or merges.
Author
Owner

@issam-seghir commented on GitHub (Jul 30, 2025):

@dosu
This is confusing , TypeScript still suggests verificationTokens and accounts in the config. Are these legacy fields? Could you clarify which version of Better Auth last used them and when they were marked as deprecated or replaced?

<!-- gh-comment-id:3136334732 --> @issam-seghir commented on GitHub (Jul 30, 2025): @dosu This is confusing , TypeScript still suggests verificationTokens and accounts in the config. Are these legacy fields? Could you clarify which version of Better Auth last used them and when they were marked as deprecated or replaced?
Author
Owner

@dosubot[bot] commented on GitHub (Jul 30, 2025):

Neither verificationTokens nor accounts were ever official config keys in Better Auth—there's no record of them being added, deprecated, or removed in any version. The only supported options are the singular account and verification keys, with token expiry handled via emailVerification config instead. If TypeScript is suggesting these fields, it's likely due to stale type caches, custom type augmentations, or third-party types in your project, not from Better Auth itself. Try clearing your .dts/type cache and check for any custom or legacy type definitions in your codebase that might be introducing these fields.
Reference: BetterAuthOptions type definitions

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:3136347969 --> @dosubot[bot] commented on GitHub (Jul 30, 2025): <!-- Answer --> Neither `verificationTokens` nor `accounts` were ever official config keys in Better Auth—there's no record of them being added, deprecated, or removed in any version. The only supported options are the singular `account` and `verification` keys, with token expiry handled via `emailVerification` config instead. If TypeScript is suggesting these fields, it's likely due to stale type caches, custom type augmentations, or third-party types in your project, not from Better Auth itself. Try clearing your `.dts`/type cache and check for any custom or legacy type definitions in your codebase that might be introducing these fields. [Reference: BetterAuthOptions type definitions](https://github.com/better-auth/better-auth/blob/4ad0a419d370de69071acf176aeb18163349b728/packages/better-auth/src/types/options.ts) <!-- 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/b232e634-d709-4207-9079-f5fb1f25e5b9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b232e634-d709-4207-9079-f5fb1f25e5b9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b232e634-d709-4207-9079-f5fb1f25e5b9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b232e634-d709-4207-9079-f5fb1f25e5b9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b232e634-d709-4207-9079-f5fb1f25e5b9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b232e634-d709-4207-9079-f5fb1f25e5b9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b232e634-d709-4207-9079-f5fb1f25e5b9?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/3701)
Author
Owner

@issam-seghir commented on GitHub (Jul 30, 2025):

Actually, I just realized that I had added a better-auth.d.ts file where I was trying to extend the Better Auth interfaces—similar to how I used to do with NextAuth during migration. For example:


declare module "better-auth" {
  interface User {
    role: UserRole;
    phone?: string | null;
    storeName?: string | null;
  }

  interface Session {
    user: {
      id: string;
      // ...
    };
  }
}

When I removed this file, the issue disappeared. So it seems the problem was caused by custom type declarations interfering with Better Auth types.

<!-- gh-comment-id:3136384837 --> @issam-seghir commented on GitHub (Jul 30, 2025): Actually, I just realized that I had added a better-auth.d.ts file where I was trying to extend the Better Auth interfaces—similar to how I used to do with NextAuth during migration. For example: ```ts declare module "better-auth" { interface User { role: UserRole; phone?: string | null; storeName?: string | null; } interface Session { user: { id: string; // ... }; } } ``` When I removed this file, the issue disappeared. So it seems the problem was caused by custom type declarations interfering with Better Auth types.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#27015