Update: 2026-06-27 05:36:53

This commit is contained in:
Hamza-Ayed
2026-06-27 05:36:53 +03:00
parent 7497bdcfae
commit bf1416b2a7
7 changed files with 109 additions and 40 deletions

View File

@@ -71,7 +71,7 @@ class LoginDriverController extends GetxController {
await CountryLogic.initializeCountry();
// box.write(BoxName.driverID, '34feffd3fa72d6bee56b');
// await getAppTester();
getJWT();
await getJWT();
super.onInit();
}
@@ -147,8 +147,9 @@ class LoginDriverController extends GetxController {
return;
}
Log.print('Security check passed');
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
dev = Platform.isAndroid ? 'android' : 'ios';
var fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ??
await DeviceHelper.getDeviceFingerprint();
var payload = {
'id': box.read(BoxName.driverID),
'password': AK.passnpassenger,
@@ -389,6 +390,9 @@ class LoginDriverController extends GetxController {
// ✅ الحصول على توكن access بدل registration قبل أي طلبات بعد تسجيل الدخول
Log.print('🔑 Getting access token after login...');
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
await storage.write(
key: BoxName.fingerPrint, value: fingerPrint.toString());
await getJWT();
Log.print('🔑 Access token obtained.');
@@ -406,10 +410,6 @@ class LoginDriverController extends GetxController {
payload: {
'captain_id': (box.read(BoxName.driverID)).toString()
});
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
await storage.write(
key: BoxName.fingerPrint, value: fingerPrint.toString());
// print(jsonDecode(token)['data'][0]['token'].toString());
// print(box.read(BoxName.tokenDriver).toString());
// if (box.read(BoxName.emailDriver).toString() !=