refactor: migrate JWT storage to secure storage, update assets, and enhance login verification logic.
This commit is contained in:
@@ -479,8 +479,7 @@ class AI extends GetxController {
|
||||
bool isLoadingVehicleFrontSy = false;
|
||||
bool isLoadingVehicleBackSy = false;
|
||||
Future<void> sendToAI(String type, {required File imageFile}) async {
|
||||
final _jwt = box.read(BoxName.jwt);
|
||||
final String _token = _jwt != null ? r(_jwt).split(AppInformation.addd)[0] : '';
|
||||
final String _token = await storage.read(key: BoxName.jwt) ?? '';
|
||||
final headers = {
|
||||
'Authorization': 'Bearer $_token',
|
||||
'X-HMAC-Auth': '${box.read(BoxName.hmac)}',
|
||||
|
||||
@@ -488,7 +488,7 @@ class ScanDocumentsByApi extends GetxController {
|
||||
update();
|
||||
|
||||
final String token =
|
||||
box.read(BoxName.jwt)?.toString().split(AppInformation.addd)[0] ?? '';
|
||||
await storage.read(key: BoxName.jwt) ?? '';
|
||||
final String fingerPrint =
|
||||
box.read(BoxName.deviceFingerprint)?.toString() ?? '';
|
||||
final String driverID = box.read(BoxName.driverID).toString();
|
||||
|
||||
@@ -312,8 +312,7 @@ class ImageController extends GetxController {
|
||||
required String filename,
|
||||
required String methodLabel,
|
||||
}) async {
|
||||
final jwt = box.read(BoxName.jwt);
|
||||
final String token = jwt != null ? r(jwt).split(AppInformation.addd)[0] : '';
|
||||
final String token = await storage.read(key: BoxName.jwt) ?? '';
|
||||
final String fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ?? '';
|
||||
final int fileSizeBytes = await file.length();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user