From 62e74d205d68f17e753e49bb3af726b20f877ad8 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Fri, 15 May 2026 15:39:58 +0300 Subject: [PATCH] Update: 2026-05-15 15:39:58 --- backend/config/db.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/config/db.php b/backend/config/db.php index 2d7380e..3a6a9c1 100644 --- a/backend/config/db.php +++ b/backend/config/db.php @@ -40,17 +40,20 @@ if (!$envLoaded) { } // Security: API Key Validation -$expectedApiKey = $_ENV['API_KEY'] ?? 'JORDAN_BOT_SECRET_2026'; // Fallback if not in .env +$expectedApiKey = $_ENV['API_KEY'] ?? 'JORDAN_BOT_SECRET_2026'; $headers = getallheaders(); $providedKey = $headers['X-API-Key'] ?? ($headers['x-api-key'] ?? null); +// Debug Logging +error_log("JordanBot API Check: Provided Key: [$providedKey], Expected Key (from ENV): [" . ($_ENV['API_KEY'] ?? 'NULL') . "], Fallback: [JORDAN_BOT_SECRET_2026]"); + if ($providedKey !== $expectedApiKey) { http_response_code(401); echo json_encode(['success' => false, 'message' => 'Unauthorized: Invalid or missing API Key']); exit; } -// Extra Security: App Signature Fingerprint Validation (Optional) +// Extra Security: App Signature Fingerprint Validation (Temporarily Disabled for Debugging) /* $expectedSignatures = $_ENV['APP_SIGNATURE_SHA256'] ?? null; if (!empty($expectedSignatures)) {