Update: 2026-07-21 20:55:19

This commit is contained in:
Hamza-Ayed
2026-07-21 20:55:20 +03:00
parent 586deec4f4
commit 3d0c266b7a
2 changed files with 4 additions and 7 deletions
+3 -7
View File
@@ -87,11 +87,8 @@ function getNabehBearerToken(): ?string {
'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);
$debugLog = "[Nabeh Auth Debug] Request: $apiUrl | Response: $response";
error_log($debugLog);
if ($response) {
$decoded = json_decode($response, true);
@@ -102,8 +99,7 @@ function getNabehBearerToken(): ?string {
if ($redis) {
try {
$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);
error_log("[Nabeh Auth Debug] Token cached in Redis successfully.");
} catch (Exception $e) {
$msg = "⚠️ [Nabeh Auth Redis Cache Save] Error saving token: " . $e->getMessage();
error_log($msg);
@@ -15,6 +15,7 @@ import '../../constant/char_map.dart';
import '../../constant/colors.dart';
import '../../constant/info.dart';
import '../../main.dart';
import 'encrypt_decrypt.dart';
class ImageController extends GetxController {
File? myImage;