Update: 2026-07-10 13:41:34

This commit is contained in:
Hamza-Ayed
2026-07-10 13:41:34 +03:00
parent be6e5bed92
commit 5fb2c25504
3 changed files with 11 additions and 3 deletions
+8
View File
@@ -85,6 +85,12 @@ function getNabehBearerToken(): ?string {
$response = curlCall("POST", $apiUrl, json_encode($payload), [ $response = curlCall("POST", $apiUrl, json_encode($payload), [
'Content-Type: application/json' 'Content-Type: application/json'
]); ]);
$debugLog = "[ " . date('Y-m-d H:i:s') . " ]\n";
$debugLog .= "Request to: $apiUrl\n";
$debugLog .= "Payload: " . json_encode($payload) . "\n";
$debugLog .= "Response: " . $response . "\n";
file_put_contents(__DIR__ . '/../../../logs/nabeh_debug.txt', $debugLog, FILE_APPEND);
if ($response) { if ($response) {
$decoded = json_decode($response, true); $decoded = json_decode($response, true);
@@ -95,6 +101,8 @@ function getNabehBearerToken(): ?string {
if ($redis) { if ($redis) {
try { try {
$redis->setex('nabeh_bearer_token', 86400, $token); $redis->setex('nabeh_bearer_token', 86400, $token);
$debugLog = "Token cached in Redis successfully.\n";
file_put_contents(__DIR__ . '/../../../logs/nabeh_debug.txt', $debugLog, FILE_APPEND);
} catch (Exception $e) { } catch (Exception $e) {
$msg = "⚠️ [Nabeh Auth Redis Cache Save] Error saving token: " . $e->getMessage(); $msg = "⚠️ [Nabeh Auth Redis Cache Save] Error saving token: " . $e->getMessage();
error_log($msg); error_log($msg);
+1 -1
View File
@@ -574,7 +574,7 @@ class AppLink {
"$auth/passenger/remove_account.php"; "$auth/passenger/remove_account.php";
static String get verifyEmail => "$auth/verifyEmail.php"; static String get verifyEmail => "$auth/verifyEmail.php";
//===================Auth Captin============ //===================Auth Captin============
static String get authCaptin => '$server/auth/captin'; static String get authCaptin => '$server/auth/driver';
static String get loginCaptin => "$authCaptin/login.php"; static String get loginCaptin => "$authCaptin/login.php";
static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php"; static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php";
static String get loginUsingCredentialsWithoutGoogle => static String get loginUsingCredentialsWithoutGoogle =>
+2 -2
View File
@@ -470,7 +470,7 @@ class AppLink {
static String get loginFirstTime => "$server/loginFirstTime.php"; static String get loginFirstTime => "$server/loginFirstTime.php";
static String get getTesterApp => "$auth/Tester/getTesterApp.php"; static String get getTesterApp => "$auth/Tester/getTesterApp.php";
static String get updateTesterApp => "$auth/Tester/updateTesterApp.php"; static String get updateTesterApp => "$auth/Tester/updateTesterApp.php";
static String get signUp => "$auth/signup.php"; static String get signUp => "$auth/passenger/register.php";
static String get savePassengerLocation => static String get savePassengerLocation =>
"$auth/passenger/save_location.php"; "$auth/passenger/save_location.php";
static String get sendVerifyEmail => "$auth/sendVerifyEmail.php"; static String get sendVerifyEmail => "$auth/sendVerifyEmail.php";
@@ -485,7 +485,7 @@ class AppLink {
"$auth/passenger/remove_account.php"; "$auth/passenger/remove_account.php";
static String get verifyEmail => "$auth/verifyEmail.php"; static String get verifyEmail => "$auth/verifyEmail.php";
//===================Auth Captin============ //===================Auth Captin============
static String get authCaptin => '$server/auth/captin'; static String get authCaptin => '$server/auth/driver';
static String get loginCaptin => "$authCaptin/login.php"; static String get loginCaptin => "$authCaptin/login.php";
static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php"; static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php";
static String get signUpCaptin => "$authCaptin/register.php"; static String get signUpCaptin => "$authCaptin/register.php";