Update: 2026-07-26 02:51:53
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
@@ -29,7 +30,10 @@ class CRUD {
|
||||
return;
|
||||
}
|
||||
|
||||
dev = Platform.isAndroid ? 'android' : 'ios';
|
||||
// Note: We send 'android' instead of 'web' because the backend's loginAdmin.php
|
||||
// explicitly validates the audience against 'allowedDriver1' (android) and 'allowedDriver2' (ios).
|
||||
// Sending 'web' will cause a 400 Bad Request error.
|
||||
dev = kIsWeb ? 'android' : (Platform.isAndroid ? 'android' : 'ios');
|
||||
|
||||
var payload = {
|
||||
'id': 'admin',
|
||||
@@ -261,7 +265,7 @@ class CRUD {
|
||||
var payload = {
|
||||
'id': box.read(BoxName.driverID) ?? '1',
|
||||
'password': AK.passnpassenger,
|
||||
'aud': '${Env.allowedWallet}${Platform.isAndroid ? 'android' : 'ios'}',
|
||||
'aud': '${Env.allowedWallet}${kIsWeb ? 'android' : (Platform.isAndroid ? 'android' : 'ios')}',
|
||||
'fingerPrint': fingerPrint
|
||||
};
|
||||
var fallbackRes = await _client.post(
|
||||
|
||||
Reference in New Issue
Block a user