You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Your subscription payment is still processing. Wait for it to finish before starting another checkout. If this takes longer than expected, contact support.',
53
+
})
54
+
}
55
+
16
56
/**
17
57
* Classify a `/subscription/upgrade` request as a personal checkout using
18
58
* the same reference resolution as the Better Auth Stripe plugin
@@ -39,11 +79,9 @@ export function isPersonalCheckoutRequest(
39
79
/**
40
80
* Guard for personal (user-referenced) checkouts on `/subscription/upgrade`.
41
81
*
42
-
* A member of an organization with an entitled paid subscription is already
43
-
* covered by that org — their usage pools to it and personal Pro
44
-
* subscriptions are paused on join — so a personal checkout would bill the
45
-
* same human twice. Throws {@link APIError} with a user-facing message; the
46
-
* checkout UI surfaces it as-is.
82
+
* Blocks both a bound, incomplete Stripe subscription and a member already
83
+
* covered by an entitled organization subscription. Throws {@link APIError}
84
+
* with a user-facing message; the checkout UI surfaces it as-is.
47
85
*
48
86
* Called from the Better Auth `hooks.before` middleware, NOT from
49
87
* `authorizeReference`: the Stripe plugin skips `authorizeReference`
@@ -54,6 +92,8 @@ export function isPersonalCheckoutRequest(
54
92
* rejected rather than risking a duplicate subscription.
0 commit comments