({ request, requestId, providerConfig }: AuthContext)
| 22 | |
| 23 | export const instantlyHandler: WebhookProviderHandler = { |
| 24 | verifyAuth({ request, requestId, providerConfig }: AuthContext): NextResponse | null { |
| 25 | const secretToken = providerConfig.secretToken as string | undefined |
| 26 | if (!secretToken) { |
| 27 | logger.warn(`[${requestId}] Instantly webhook secret token is missing`) |
| 28 | return new NextResponse('Unauthorized', { status: 401 }) |
| 29 | } |
| 30 | |
| 31 | if (!verifyTokenAuth(request, secretToken, SIM_WEBHOOK_TOKEN_HEADER)) { |
| 32 | logger.warn(`[${requestId}] Unauthorized Instantly webhook request`) |
| 33 | return new NextResponse('Unauthorized', { status: 401 }) |
| 34 | } |
| 35 | |
| 36 | return null |
| 37 | }, |
| 38 | |
| 39 | async matchEvent({ body, providerConfig, requestId }: EventMatchContext): Promise<boolean> { |
| 40 | const triggerId = providerConfig.triggerId as string | undefined |
nothing calls this directly
no test coverage detected