From 52c4f96976b6c1ed6a7eeb05ab0850c852b995e7 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Tue, 23 Jun 2026 17:42:09 +0300 Subject: [PATCH] Update: 2026-06-23 17:42:09 --- backend/auth/otp/request.php | 38 +++---------------- backend/core/bootstrap.php | 9 +++-- .../lib/controller/auth/login_controller.dart | 3 +- 3 files changed, 12 insertions(+), 38 deletions(-) diff --git a/backend/auth/otp/request.php b/backend/auth/otp/request.php index e930ecb..4b51778 100644 --- a/backend/auth/otp/request.php +++ b/backend/auth/otp/request.php @@ -92,47 +92,19 @@ switch (strtolower($country)) { case 'egypt': $sentSuccessfully = sendKazumiSms($receiver, $otp); if (!$sentSuccessfully) { - error_log("⚠️ [Egypt OTP Failover 1] Kazumi SMS failed. Falling back to Intaleq OTP WhatsApp."); + error_log("⚠️ [Egypt OTP Failover] Kazumi SMS failed. Falling back to Intaleq OTP WhatsApp."); $sentSuccessfully = sendIntaleqOtp($receiver, $otp, 'whatsapp'); - if (!$sentSuccessfully) { - error_log("⚠️ [Egypt OTP Failover 2] Intaleq OTP WhatsApp failed. Falling back to Nabeh JWT OTP text."); - $sentSuccessfully = sendNabehOtp($receiver, $otp, 'text'); - } } break; case 'syria': - // Syria uses dynamic Nabeh JWT for voice/image, static Intaleq app_key for whatsapp/sms - if ($method === 'bearer_send' || $method === 'voice' || $method === 'image') { - $sentSuccessfully = sendNabehOtp($receiver, $otp, $method); - if (!$sentSuccessfully) { - error_log("⚠️ [Syria OTP Failover] Nabeh JWT method failed. Falling back to Intaleq OTP WhatsApp."); - $sentSuccessfully = sendIntaleqOtp($receiver, $otp, 'whatsapp'); - } - } else { - $sentSuccessfully = sendIntaleqOtp($receiver, $otp, $method ?: 'whatsapp'); - if (!$sentSuccessfully) { - error_log("⚠️ [Syria OTP Failover] Intaleq OTP WhatsApp failed. Falling back to Nabeh JWT OTP text."); - $sentSuccessfully = sendNabehOtp($receiver, $otp, 'text'); - } - } + // Syria uses Intaleq app_key for whatsapp/sms + $sentSuccessfully = sendIntaleqOtp($receiver, $otp, $method ?: 'whatsapp'); break; case 'jordan': - // Jordan uses dynamic Nabeh JWT for voice/image, static Intaleq app_key for sms/whatsapp - if ($method === 'bearer_send' || $method === 'voice' || $method === 'image') { - $sentSuccessfully = sendNabehOtp($receiver, $otp, $method); - if (!$sentSuccessfully) { - error_log("⚠️ [Jordan OTP Failover] Nabeh JWT method failed. Falling back to Intaleq OTP SMS."); - $sentSuccessfully = sendIntaleqOtp($receiver, $otp, 'sms'); - } - } else { - $sentSuccessfully = sendIntaleqOtp($receiver, $otp, $method ?: 'sms'); - if (!$sentSuccessfully) { - error_log("⚠️ [Jordan OTP Failover] Intaleq OTP SMS failed. Falling back to Nabeh JWT OTP text."); - $sentSuccessfully = sendNabehOtp($receiver, $otp, 'text'); - } - } + // Jordan uses Intaleq app_key for whatsapp/sms + $sentSuccessfully = sendIntaleqOtp($receiver, $otp, $method ?: 'whatsapp'); break; default: diff --git a/backend/core/bootstrap.php b/backend/core/bootstrap.php index e9401df..9a7ee44 100644 --- a/backend/core/bootstrap.php +++ b/backend/core/bootstrap.php @@ -57,10 +57,11 @@ if ($vendorPath) require_once $vendorPath; require_once __DIR__ . '/helpers.php'; // تحديد مسار الـ .env بشكل ديناميكي -$siteUser = get_current_user(); -$homeDir = "/home/$siteUser"; -if (!is_dir($homeDir)) { - $homeDir = realpath(__DIR__ . '/../../../'); // Fallback +$homeDir = realpath(__DIR__ . '/../../../'); +if (!$homeDir || !is_dir($homeDir)) { + // Fallback if realpath fails + $siteUser = get_current_user(); + $homeDir = "/home/$siteUser"; } $envFile = getenv('ENV_FILE_PATH') ?: ($homeDir . '/.env'); diff --git a/siro_rider/lib/controller/auth/login_controller.dart b/siro_rider/lib/controller/auth/login_controller.dart index 2ddb8b9..faa47f8 100644 --- a/siro_rider/lib/controller/auth/login_controller.dart +++ b/siro_rider/lib/controller/auth/login_controller.dart @@ -113,7 +113,8 @@ class LoginController extends GetxController { Log.print('AppLink.loginFirstTime: ${AppLink.loginFirstTime}'); Log.print('payload: $payload'); - Log.print('response: $response'); + Log.print('response code: ${response.statusCode}'); + Log.print('response body: ${response.body}'); if (response.statusCode == 200) { final decoded = jsonDecode(response.body);