Update: 2026-07-10 13:41:34
This commit is contained in:
@@ -86,6 +86,12 @@ function getNabehBearerToken(): ?string {
|
|||||||
'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);
|
||||||
$token = $decoded['token'] ?? $decoded['message']['token'] ?? $decoded['jwt'] ?? $decoded['access_token'] ?? null;
|
$token = $decoded['token'] ?? $decoded['message']['token'] ?? $decoded['jwt'] ?? $decoded['access_token'] ?? null;
|
||||||
@@ -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);
|
||||||
|
|||||||
@@ -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 =>
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user