Update: 2026-05-08 14:05:50
This commit is contained in:
@@ -23,10 +23,22 @@ class AuthController extends GetxController {
|
||||
return;
|
||||
}
|
||||
isLoading.value = true;
|
||||
phone.value = phoneNumber;
|
||||
|
||||
// Normalize phone number
|
||||
String normalizedPhone = phoneNumber.replaceAll(RegExp(r'[^0-9+]'), '');
|
||||
if (normalizedPhone.startsWith('+')) {
|
||||
normalizedPhone = normalizedPhone.substring(1);
|
||||
}
|
||||
if (normalizedPhone.startsWith('07')) {
|
||||
normalizedPhone = '962' + normalizedPhone.substring(1);
|
||||
} else if (normalizedPhone.startsWith('7')) {
|
||||
normalizedPhone = '962' + normalizedPhone;
|
||||
}
|
||||
|
||||
phone.value = normalizedPhone;
|
||||
|
||||
final response = await _dio.post('auth/mobile/request-otp', data: {
|
||||
'phone': phoneNumber,
|
||||
'phone': normalizedPhone,
|
||||
});
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
Reference in New Issue
Block a user