fix cf access login

This commit is contained in:
Purple
2026-01-18 02:36:41 +00:00
parent aa486d9752
commit a84c699e5e

View File

@@ -1245,10 +1245,22 @@ function handleWebhookTest($db) {
'http_code' => $result['http_code']
]);
} else {
$errorMsg = 'Webhook test failed: ';
if ($result['error']) {
$errorMsg .= $result['error'];
} elseif ($result['http_code'] == 404) {
$errorMsg .= "HTTP 404 - Webhook URL not found. Make sure the n8n workflow is active and the webhook is in 'Production' mode (not 'Test' mode).";
} elseif ($result['http_code'] == 0) {
$errorMsg .= "Could not connect to webhook URL. Check if the URL is correct and accessible.";
} else {
$errorMsg .= "HTTP {$result['http_code']}";
}
jsonResponse([
'success' => false,
'error' => 'Webhook test failed: ' . ($result['error'] ?: "HTTP {$result['http_code']}"),
'http_code' => $result['http_code']
'error' => $errorMsg,
'http_code' => $result['http_code'],
'url_tested' => $webhookUrl
], 400);
}
}