diff --git a/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts b/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts index 0552c55ec..465d662a1 100644 --- a/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts +++ b/apps/web/src/app/(dashboard)/settings/billing/create-checkout.action.ts @@ -23,7 +23,7 @@ export const createCheckout = async ({ priceId }: CreateCheckoutOptions) => { let stripeCustomer: Stripe.Customer | null = null; // Find the Stripe customer for the current user subscription. - if (existingSubscription) { + if (existingSubscription?.periodEnd && existingSubscription.periodEnd >= new Date()) { stripeCustomer = await getStripeCustomerById(existingSubscription.customerId); if (!stripeCustomer) {