[PR #4037] [MERGED] fix(stripe): prevent undefined assignment to optional properties #13397

Closed
opened 2026-04-13 08:54:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4037
Author: @Kinfe123
Created: 8/16/2025
Status: Merged
Merged: 8/17/2025
Merged by: @Bekacru

Base: canaryHead: fix/stripe-schema-typing-issues


📝 Commits (8)

  • c6f2d5c fix(org): prevent foreign key constraint violation when creating invitations without teams
  • 90bd9d4 fix(stripe): prevent undefined assignment to optional properties
  • d020823 lint
  • dd5d10a clean up
  • 88517ba clean up
  • 8111ae0 update
  • 25bd522 merge-schema returns S
  • 469745b Merge branch 'canary' into fix/stripe-schema-typing-issues

📊 Changes

1 file changed (+17 additions, -8 deletions)

View changed files

📝 packages/stripe/src/schema.ts (+17 -8)

📄 Description

Summary by cubic

Prevents undefined being assigned to optional Stripe schema properties by stripping disabled subscription fields before merge and returning a correctly typed schema.

  • Bug Fixes
    • Build a base schema from user (+subscriptions when enabled) and merge without mutating options.schema.
    • Remove subscription from overrides when subscriptions are disabled instead of setting it to undefined.
    • Add explicit AuthPluginSchema typing and satisfies assertions for safer returns.

🔄 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/4037 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 8/16/2025 **Status:** ✅ Merged **Merged:** 8/17/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/stripe-schema-typing-issues` --- ### 📝 Commits (8) - [`c6f2d5c`](https://github.com/better-auth/better-auth/commit/c6f2d5cb54ee2f1129fc88b91c71757b2eb7639c) fix(org): prevent foreign key constraint violation when creating invitations without teams - [`90bd9d4`](https://github.com/better-auth/better-auth/commit/90bd9d44a86b0e22c393199159df82dfe866bca4) fix(stripe): prevent undefined assignment to optional properties - [`d020823`](https://github.com/better-auth/better-auth/commit/d0208237edf1870cb35219bdbbcc517dc7f32bf3) lint - [`dd5d10a`](https://github.com/better-auth/better-auth/commit/dd5d10a39994747179f5c9fbe4131a077634d7b2) clean up - [`88517ba`](https://github.com/better-auth/better-auth/commit/88517bae4c47209ccfec51c552818b83d1661e60) clean up - [`8111ae0`](https://github.com/better-auth/better-auth/commit/8111ae0944207f9f61bdabbe44bb72d725c082dd) update - [`25bd522`](https://github.com/better-auth/better-auth/commit/25bd522f376c5f052e60cfa7d884fc7b3b94c4d7) merge-schema returns S - [`469745b`](https://github.com/better-auth/better-auth/commit/469745bf387a91a60012c169126830ad7de8627d) Merge branch 'canary' into fix/stripe-schema-typing-issues ### 📊 Changes **1 file changed** (+17 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `packages/stripe/src/schema.ts` (+17 -8) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Prevents undefined being assigned to optional Stripe schema properties by stripping disabled subscription fields before merge and returning a correctly typed schema. - **Bug Fixes** - Build a base schema from user (+subscriptions when enabled) and merge without mutating options.schema. - Remove subscription from overrides when subscriptions are disabled instead of setting it to undefined. - Add explicit AuthPluginSchema typing and satisfies assertions for safer returns. <!-- 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-04-13 08:54:34 -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#13397