[PR #4432] [MERGED] fix(stripe): prevent multiple free trials #5380

Closed
opened 2026-03-13 12:20:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4432
Author: @hendrik-krebs
Created: 9/4/2025
Status: Merged
Merged: 9/5/2025
Merged by: @Bekacru

Base: canaryHead: fix/prevent-multiple-stripe-trials


📝 Commits (1)

  • f00cc02 fix(stripe): prevent multiple free trials

📊 Changes

1 file changed (+9 additions, -5 deletions)

View changed files

📝 packages/stripe/src/index.ts (+9 -5)

📄 Description

Description

Problem

Currently, we only check if the current subscription is in the trialing state.
This allows users to receive multiple free trials: once a trialing subscription transitions to active or canceled, the check no longer detects that a trial was already used.

Solution

  • Added a check for previous subscriptions.
  • A subscription is considered to have used a trial if it has trialStart or trialEnd set (or was once trialing).
  • This ensures that once a user has had a trial, they cannot start another one, even after canceling.

Open Question

Right now, the check is per plan (a user could get one trial per plan).
Should we instead enforce it per customer (only one trial total, regardless of plan)?


Summary by cubic

Prevent multiple Stripe free trials by checking a customer’s past subscriptions for the same plan, not just the current one. A new trial is blocked if any prior subscription on that plan ever had a trial (trialStart/trialEnd or trialing); this remains per-plan, not per-customer.


🔄 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/4432 **Author:** [@hendrik-krebs](https://github.com/hendrik-krebs) **Created:** 9/4/2025 **Status:** ✅ Merged **Merged:** 9/5/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/prevent-multiple-stripe-trials` --- ### 📝 Commits (1) - [`f00cc02`](https://github.com/better-auth/better-auth/commit/f00cc02b4d359e72a9b5a4094ade71d7645c1316) fix(stripe): prevent multiple free trials ### 📊 Changes **1 file changed** (+9 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/index.ts` (+9 -5) </details> ### 📄 Description ### **Description** #### Problem Currently, we only check if the **current subscription** is in the `trialing` state. This allows users to receive multiple free trials: once a trialing subscription transitions to `active` or `canceled`, the check no longer detects that a trial was already used. #### Solution - Added a check for **previous subscriptions**. - A subscription is considered to have used a trial if it has `trialStart` or `trialEnd` set (or was once `trialing`). - This ensures that once a user has had a trial, they cannot start another one, even after canceling. #### Open Question Right now, the check is **per plan** (a user could get one trial per plan). Should we instead enforce it **per customer** (only one trial total, regardless of plan)? <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Prevent multiple Stripe free trials by checking a customer’s past subscriptions for the same plan, not just the current one. A new trial is blocked if any prior subscription on that plan ever had a trial (trialStart/trialEnd or trialing); this remains per-plan, not per-customer. <!-- 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-03-13 12:20:52 -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#5380