( body: unknown, request: NextRequest, requestId: string, path: string, rawBody?: string )
| 146 | const CHALLENGE_PROVIDERS = ['monday', 'slack', 'microsoft-teams', 'whatsapp', 'zoom'] as const |
| 147 | |
| 148 | export async function handleProviderChallenges( |
| 149 | body: unknown, |
| 150 | request: NextRequest, |
| 151 | requestId: string, |
| 152 | path: string, |
| 153 | rawBody?: string |
| 154 | ): Promise<NextResponse | null> { |
| 155 | for (const provider of CHALLENGE_PROVIDERS) { |
| 156 | const handler = getProviderHandler(provider) |
| 157 | if (handler.handleChallenge) { |
| 158 | const response = await handler.handleChallenge(body, request, requestId, path, rawBody) |
| 159 | if (response) { |
| 160 | return response |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | return null |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Returns a verification response for provider reachability probes that happen |
no test coverage detected