Skip to content

Commit bc2ad3e

Browse files
committed
fix(billing): treat a whitespace-only Stripe webhook secret as missing
1 parent 3940956 commit bc2ad3e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/sim/lib/auth/auth.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,16 @@ if (env.NODE_ENV === 'production') {
244244
*/
245245
function resolveStripeBilling() {
246246
if (!isBillingEnabled || !env.STRIPE_SECRET_KEY) return null
247-
if (!env.STRIPE_WEBHOOK_SECRET) {
247+
const webhookSecret = env.STRIPE_WEBHOOK_SECRET
248+
if (!webhookSecret?.trim()) {
248249
logger.error(
249250
'BILLING_ENABLED and STRIPE_SECRET_KEY are set but STRIPE_WEBHOOK_SECRET is not; the Stripe billing plugin is disabled until it is configured'
250251
)
251252
return null
252253
}
253254
return {
254255
client: new Stripe(env.STRIPE_SECRET_KEY, { apiVersion: '2025-08-27.basil' }),
255-
webhookSecret: env.STRIPE_WEBHOOK_SECRET,
256+
webhookSecret,
256257
}
257258
}
258259

0 commit comments

Comments
 (0)