Skip to content

Commit 1478de1

Browse files
waleedlatif1claude
andcommitted
fix(webhooks): validate auth token is set when requireAuth is enabled at deploy time
Rejects deployment with a clear error message if a generic webhook trigger has requireAuth enabled but no authentication token configured, rather than letting requests fail with 401 at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 60610b7 commit 1478de1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

apps/sim/lib/webhooks/deploy.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,18 @@ export async function saveTriggerWebhooksForDeploy({
447447
}
448448
}
449449

450+
if (providerConfig.requireAuth && !providerConfig.token) {
451+
await restorePreviousSubscriptions()
452+
return {
453+
success: false,
454+
error: {
455+
message:
456+
'Authentication is enabled but no token is configured. Please set an authentication token or disable authentication.',
457+
status: 400,
458+
},
459+
}
460+
}
461+
450462
webhookConfigs.set(block.id, { provider, providerConfig, triggerPath, triggerDef })
451463

452464
if (providerConfig.credentialSetId) {

0 commit comments

Comments
 (0)