File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
app/api/webhooks/trigger/[path] Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,6 @@ export async function POST(
7373 const responses : NextResponse [ ] = [ ]
7474
7575 for ( const { webhook : foundWebhook , workflow : foundWorkflow } of webhooksForPath ) {
76- // Short-circuit: reachability test is a quick body-only check
77- const reachabilityResponse = handleProviderReachabilityTest ( foundWebhook , body , requestId )
78- if ( reachabilityResponse ) {
79- return reachabilityResponse
80- }
81-
8276 const authError = await verifyProviderAuth (
8377 foundWebhook ,
8478 foundWorkflow ,
@@ -94,6 +88,11 @@ export async function POST(
9488 return authError
9589 }
9690
91+ const reachabilityResponse = handleProviderReachabilityTest ( foundWebhook , body , requestId )
92+ if ( reachabilityResponse ) {
93+ return reachabilityResponse
94+ }
95+
9796 const preprocessResult = await checkWebhookPreprocessing ( foundWorkflow , foundWebhook , requestId )
9897 if ( preprocessResult . error ) {
9998 if ( webhooksForPath . length > 1 ) {
Original file line number Diff line number Diff line change @@ -106,7 +106,6 @@ export type WebhookExecutionPayload = {
106106 blockId ?: string
107107 workspaceId ?: string
108108 credentialId ?: string
109- credentialAccountUserId ?: string
110109}
111110
112111export async function executeWebhookJob ( payload : WebhookExecutionPayload ) {
@@ -206,9 +205,9 @@ async function executeWebhookJobInternal(
206205 const [ workflowData , webhookRows , resolvedCredentialUserId ] = await Promise . all ( [
207206 loadDeployedWorkflowState ( payload . workflowId , workspaceId ) ,
208207 db . select ( ) . from ( webhook ) . where ( eq ( webhook . id , payload . webhookId ) ) . limit ( 1 ) ,
209- ! payload . credentialAccountUserId && payload . credentialId
208+ payload . credentialId
210209 ? resolveCredentialAccountUserId ( payload . credentialId )
211- : Promise . resolve ( payload . credentialAccountUserId ) ,
210+ : Promise . resolve ( undefined ) ,
212211 ] )
213212 const credentialAccountUserId = resolvedCredentialUserId
214213 if ( payload . credentialId && ! credentialAccountUserId ) {
You can’t perform that action at this time.
0 commit comments