25-11-18/1
This commit is contained in:
@@ -316,14 +316,12 @@ Download the Intaleq app now and enjoy your ride!
|
||||
/// Formats a phone number to the standard Syrian international format (+963...).
|
||||
String _formatSyrianPhoneNumber(String input) {
|
||||
String digitsOnly = input.replaceAll(RegExp(r'\D'), '');
|
||||
if (digitsOnly.startsWith('963')) {
|
||||
return '+$digitsOnly';
|
||||
}
|
||||
|
||||
if (digitsOnly.startsWith('09') && digitsOnly.length == 10) {
|
||||
return '+963${digitsOnly.substring(1)}';
|
||||
return '963${digitsOnly.substring(1)}';
|
||||
}
|
||||
if (digitsOnly.length == 9 && digitsOnly.startsWith('9')) {
|
||||
return '+963$digitsOnly';
|
||||
return '963$digitsOnly';
|
||||
}
|
||||
return input; // Fallback for unrecognized formats
|
||||
}
|
||||
@@ -386,7 +384,7 @@ Download the Intaleq app now and enjoy your ride!
|
||||
});
|
||||
|
||||
if (response != 'failure') {
|
||||
var d = jsonDecode(response);
|
||||
var d = (response);
|
||||
mySnackbarSuccess('Invite sent successfully'.tr);
|
||||
String message = '${'*Intaleq APP CODE*'.tr}\n\n'
|
||||
'${"Use this code in registration".tr}\n\n'
|
||||
|
||||
@@ -150,7 +150,7 @@ class LoginDriverController extends GetxController {
|
||||
// Log.print('response.request: ${response1.request}');
|
||||
// Log.print('response.body: ${response1.body}');
|
||||
// print(payload);
|
||||
Log.print('payment["jwt"]: ${jsonDecode(response1.body)['jwt']}');
|
||||
// Log.print('payment["jwt"]: ${jsonDecode(response1.body)['jwt']}');
|
||||
await box.write(BoxName.hmac, jsonDecode(response1.body)['hmac']);
|
||||
return jsonDecode(response1.body)['jwt'].toString();
|
||||
}
|
||||
@@ -199,7 +199,7 @@ class LoginDriverController extends GetxController {
|
||||
'password': box.read(BoxName.emailDriver),
|
||||
'aud': '${AK.allowed}$dev',
|
||||
};
|
||||
print(payload);
|
||||
// print(payload);
|
||||
var response1 = await http.post(
|
||||
Uri.parse(AppLink.loginJwtDriver),
|
||||
body: payload,
|
||||
@@ -263,7 +263,7 @@ class LoginDriverController extends GetxController {
|
||||
// 'email': email ?? 'yet',
|
||||
'id': driverID,
|
||||
});
|
||||
Log.print('res: ${res}');
|
||||
// Log.print('res: ${res}');
|
||||
if (res == 'failure') {
|
||||
await isPhoneVerified();
|
||||
isloading = false; // <--- أضفت هذا أيضاً
|
||||
|
||||
@@ -47,11 +47,13 @@ class PhoneAuthHelper {
|
||||
}
|
||||
|
||||
/// Verifies the OTP and logs the user in.
|
||||
static Future<void> verifyOtp(String phoneNumber, String otp) async {
|
||||
static Future<void> verifyOtp(String phoneNumber) async {
|
||||
try {
|
||||
final response = await CRUD().post(
|
||||
link: _verifyOtpUrl,
|
||||
payload: {'phone_number': phoneNumber, 'otp': otp},
|
||||
payload: {
|
||||
'phone_number': phoneNumber,
|
||||
},
|
||||
);
|
||||
|
||||
if (response != 'failure') {
|
||||
|
||||
Reference in New Issue
Block a user