Update: 2026-07-21 20:40:48
This commit is contained in:
@@ -110,6 +110,7 @@ class BoxName {
|
||||
static const String tripData = 'tripData';
|
||||
static const String parentTripSelected = 'parentTripSelected';
|
||||
static const String styleVersion = 'styleVersion';
|
||||
static const String isDestinationMatch = 'isDestinationMatch'; // 🆕 AI Destination Matching
|
||||
static const String isDestinationMatch =
|
||||
'isDestinationMatch'; // 🆕 AI Destination Matching
|
||||
static const String isPrime = 'isPrime'; // 👑 Siro Prime subscription status
|
||||
}
|
||||
|
||||
@@ -127,8 +127,8 @@ class LoginController extends GetxController {
|
||||
|
||||
if (jwt != null) {
|
||||
// نشفر الـ JWT بالتشفير الثلاثي قبل التخزين في GetStorage
|
||||
box.write(BoxName.jwt, c(jwt));
|
||||
storage.write(key: BoxName.jwt, value: c(jwt));
|
||||
box.write(BoxName.jwt, (jwt));
|
||||
storage.write(key: BoxName.jwt, value: (jwt));
|
||||
}
|
||||
|
||||
await EncryptionHelper.initialize();
|
||||
@@ -159,8 +159,8 @@ class LoginController extends GetxController {
|
||||
: decoded['jwt']);
|
||||
|
||||
if (jwt != null) {
|
||||
box.write(BoxName.jwt, c(jwt));
|
||||
storage.write(key: BoxName.jwt, value: c(jwt));
|
||||
box.write(BoxName.jwt, (jwt));
|
||||
storage.write(key: BoxName.jwt, value: (jwt));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -481,7 +481,8 @@ class LoginController extends GetxController {
|
||||
'fingerPrint': fingerPrint,
|
||||
'aud': '${AK.allowed}${Platform.isAndroid ? 'android' : 'ios'}',
|
||||
};
|
||||
Log.print("Tester Login Payload: email=${payload['email']}, password=${payload['password']}, aud=${payload['aud']}");
|
||||
Log.print(
|
||||
"Tester Login Payload: email=${payload['email']}, password=${payload['password']}, aud=${payload['aud']}");
|
||||
|
||||
var response = await http.post(
|
||||
Uri.parse(AppLink.loginUsingCredentialsWithoutGooglePassenger),
|
||||
@@ -498,8 +499,8 @@ class LoginController extends GetxController {
|
||||
|
||||
// حفظ التوكن
|
||||
if (jwt != null) {
|
||||
box.write(BoxName.jwt, c(jwt));
|
||||
await storage.write(key: BoxName.jwt, value: c(jwt));
|
||||
box.write(BoxName.jwt, (jwt));
|
||||
await storage.write(key: BoxName.jwt, value: (jwt));
|
||||
}
|
||||
|
||||
box.write(BoxName.isVerified, '1');
|
||||
@@ -563,7 +564,9 @@ class LoginController extends GetxController {
|
||||
}
|
||||
if (!serviceEnabled) {
|
||||
// Location services are still not enabled, show a message
|
||||
mySnackbarError('Please enable location services in your device settings to continue.'.tr);
|
||||
mySnackbarError(
|
||||
'Please enable location services in your device settings to continue.'
|
||||
.tr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -572,15 +575,19 @@ class LoginController extends GetxController {
|
||||
permissionGranted = await location.hasPermission();
|
||||
|
||||
if (permissionGranted == loc.PermissionStatus.deniedForever) {
|
||||
mySnackbarError('Please go to app settings and grant location permission.'.tr);
|
||||
mySnackbarError(
|
||||
'Please go to app settings and grant location permission.'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (permissionGranted == loc.PermissionStatus.denied) {
|
||||
permissionGranted = await location.requestPermission();
|
||||
if (permissionGranted != loc.PermissionStatus.granted && permissionGranted != loc.PermissionStatus.grantedLimited) {
|
||||
if (permissionGranted != loc.PermissionStatus.granted &&
|
||||
permissionGranted != loc.PermissionStatus.grantedLimited) {
|
||||
// Location permission is still not granted, handle the error
|
||||
mySnackbarError('Location permission is required to use the app. Please grant permission.'.tr);
|
||||
mySnackbarError(
|
||||
'Location permission is required to use the app. Please grant permission.'
|
||||
.tr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -598,7 +605,6 @@ class LoginController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
// sendPassengerLocation: تسجيل موقع فتح التطبيق للراكب
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -6,6 +6,7 @@ import '../../../print.dart';
|
||||
import '../../views/auth/otp_page.dart';
|
||||
import '../../views/widgets/error_snakbar.dart';
|
||||
import '../functions/crud.dart';
|
||||
import '../functions/encrypt_decrypt.dart';
|
||||
import '../functions/package_info.dart';
|
||||
import '../functions/country_logic.dart';
|
||||
import 'login_controller.dart';
|
||||
@@ -16,7 +17,8 @@ class PhoneAuthHelper {
|
||||
// Define your server URLs
|
||||
static final String _sendOtpUrl = '${AppLink.server}/auth/otp/request.php';
|
||||
static final String _verifyOtpUrl = '${AppLink.server}/auth/otp/verify.php';
|
||||
static final String _registerUrl = '${AppLink.server}/auth/passenger/register.php';
|
||||
static final String _registerUrl =
|
||||
'${AppLink.server}/auth/passenger/register.php';
|
||||
|
||||
// removed formatSyrianPhone
|
||||
|
||||
@@ -82,6 +84,14 @@ class PhoneAuthHelper {
|
||||
Log.print('isRegistered: ${isRegistered}');
|
||||
|
||||
if (isRegistered) {
|
||||
final jwtToken = data['message']?['jwt'] ??
|
||||
data['message']?['token'] ??
|
||||
data['message']?['access_token'];
|
||||
if (jwtToken != null && jwtToken.toString().isNotEmpty) {
|
||||
box.write(BoxName.jwt, (jwtToken.toString()));
|
||||
await storage.write(
|
||||
key: BoxName.jwt, value: (jwtToken.toString()));
|
||||
}
|
||||
// ✅ المستخدم موجود مسبقاً -> تسجيل دخول مباشر
|
||||
await _handleSuccessfulLogin(data['message']['passenger']);
|
||||
} else {
|
||||
|
||||
@@ -76,10 +76,11 @@ class ImageController extends GetxController {
|
||||
length,
|
||||
filename: basename(file.path),
|
||||
);
|
||||
final String fingerPrint = box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
||||
final String fingerPrint =
|
||||
box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
||||
request.headers.addAll({
|
||||
'Authorization':
|
||||
'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}',
|
||||
'Bearer ${(box.read(BoxName.jwt)).toString().split(AppInformation.addd)[0]}',
|
||||
'X-Device-FP': fingerPrint,
|
||||
});
|
||||
// Set the file name to the driverID
|
||||
|
||||
@@ -70,8 +70,9 @@ class ComplaintController extends GetxController {
|
||||
|
||||
var uri = Uri.parse('${AppLink.server}/upload_audio.php');
|
||||
var request = http.MultipartRequest('POST', uri);
|
||||
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
||||
final String fingerPrint = box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
||||
String token = (box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
||||
final String fingerPrint =
|
||||
box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
||||
|
||||
var mimeType = lookupMimeType(audioFile.path);
|
||||
// ** التعديل: تم استخدام نفس هيدر التوثيق **
|
||||
@@ -146,7 +147,7 @@ class ComplaintController extends GetxController {
|
||||
// 3. استخراج البيانات المطلوبة
|
||||
final rideId = feedBack[0]['id'].toString(); // ! تأكد أن اسم حقل ID صحيح
|
||||
final complaint = complaintController.text;
|
||||
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
||||
String token = (box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
||||
|
||||
// 4. استدعاء سكربت PHP الجديد باستخدام http.post
|
||||
final response = await http.post(
|
||||
|
||||
Reference in New Issue
Block a user