MCPcopy Index your code
hub / github.com/simstudioai/sim / verifyAuth

Function verifyAuth

apps/sim/lib/webhooks/providers/instantly.ts:24–37  ·  view source on GitHub ↗
({ request, requestId, providerConfig }: AuthContext)

Source from the content-addressed store, hash-verified

22
23export 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

Callers

nothing calls this directly

Calls 2

verifyTokenAuthFunction · 0.90
warnMethod · 0.65

Tested by

no test coverage detected