[GH-ISSUE #4539] Trial abuse potential - users can get multiple trials by canceling and resubscribing #18605

Closed
opened 2026-04-15 17:09:01 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @saeedesmaili on GitHub (Sep 9, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/4539

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Set up better-auth with stripe plugin and configure trial periods:
  freeTrial: {
    days: 7
  }
  1. Create a user account and subscribe to get the 7-day trial
  2. Cancel the subscription completely (let it fully cancel)
  3. Wait for subscription to show as "canceled" in database
  4. Same user goes back to pricing page and tries to subscribe again
  5. Stripe checkout page shows another 7-day trial offer

Current vs. Expected behavior

Following the steps above, I expected the system to either block the user from getting another trial or at least not offer trial pricing in Stripe checkout. Instead, Stripe is happily offering another full 7-day trial to the same user who already used one.

What version of Better Auth are you using?

1.3.7

System info

better-auth/cli doesn't seem to have `info` command? 🤔

npx @better-auth/cli info
Usage: better-auth [options] [command]

Better Auth CLI

Options:
  -V, --version       output the version number
  -h, --help          display help for command

Commands:
  init [options]
  migrate [options]
  generate [options]
  secret

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

Backend

Auth config (if applicable)


Additional context

No response

Originally created by @saeedesmaili on GitHub (Sep 9, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/4539 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Set up better-auth with stripe plugin and configure trial periods: ``` freeTrial: { days: 7 } ``` 2. Create a user account and subscribe to get the 7-day trial 3. Cancel the subscription completely (let it fully cancel) 4. Wait for subscription to show as "canceled" in database 5. Same user goes back to pricing page and tries to subscribe again 6. Stripe checkout page shows another 7-day trial offer ### Current vs. Expected behavior Following the steps above, I expected the system to either block the user from getting another trial or at least not offer trial pricing in Stripe checkout. Instead, Stripe is happily offering another full 7-day trial to the same user who already used one. ### What version of Better Auth are you using? 1.3.7 ### System info ```bash better-auth/cli doesn't seem to have `info` command? 🤔 npx @better-auth/cli info Usage: better-auth [options] [command] Better Auth CLI Options: -V, --version output the version number -h, --help display help for command Commands: init [options] migrate [options] generate [options] secret ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-15 17:09:02 -05:00
Author
Owner

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

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

This is expected behavior with Better Auth 1.3.7 and the Stripe plugin. The current implementation checks for previous trials by looking at local subscription records for the same user and plan, but it only blocks a new trial if there is an active or historical trial recorded in the database. If a user cancels and their previous trial subscription is fully canceled, the system does not prevent them from getting another trial if they resubscribe, since it doesn't track trial usage beyond the local subscription check. There are no built-in guards against repeated trials for the same user, and no recent or open pull requests address this scenario [source].

To prevent trial abuse, you would need to implement custom logic—such as tracking in your own database whether a user has ever consumed a trial for a given plan, and then using hooks like getCheckoutSessionParams or onTrialStart to block or modify trial eligibility before creating a new Stripe checkout session [source]. This is not handled out-of-the-box, but the plugin provides extension points for you to add this logic.

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:3269474642 --> @dosubot[bot] commented on GitHub (Sep 9, 2025): <!-- Greeting --> Hi @saeedesmaili! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the better-auth team. <!-- Answer --> This is expected behavior with Better Auth 1.3.7 and the Stripe plugin. The current implementation checks for previous trials by looking at local subscription records for the same user and plan, but it only blocks a new trial if there is an active or historical trial recorded in the database. If a user cancels and their previous trial subscription is fully canceled, the system does not prevent them from getting another trial if they resubscribe, since it doesn't track trial usage beyond the local subscription check. There are no built-in guards against repeated trials for the same user, and no recent or open pull requests address this scenario [[source]](https://github.com/better-auth/better-auth/blob/84c5f563af9a019ae33138ff612646e1d760abdb/packages/stripe/src/index.ts). To prevent trial abuse, you would need to implement custom logic—such as tracking in your own database whether a user has ever consumed a trial for a given plan, and then using hooks like `getCheckoutSessionParams` or `onTrialStart` to block or modify trial eligibility before creating a new Stripe checkout session [[source]](https://github.com/better-auth/better-auth/blob/84c5f563af9a019ae33138ff612646e1d760abdb/packages/stripe/src/types.ts). This is not handled out-of-the-box, but the plugin provides extension points for you to add this logic. <!-- 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/62027fab-76aa-4e0b-8401-9546713bf0c7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/62027fab-76aa-4e0b-8401-9546713bf0c7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/62027fab-76aa-4e0b-8401-9546713bf0c7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/62027fab-76aa-4e0b-8401-9546713bf0c7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/62027fab-76aa-4e0b-8401-9546713bf0c7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/62027fab-76aa-4e0b-8401-9546713bf0c7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/62027fab-76aa-4e0b-8401-9546713bf0c7?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/4539)
Author
Owner

@RikhiSingh commented on GitHub (Sep 10, 2025):

Hi @saeedesmaili, I resolved this in #4562

<!-- gh-comment-id:3274992904 --> @RikhiSingh commented on GitHub (Sep 10, 2025): Hi @saeedesmaili, I resolved this in #4562
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18605