mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
forget password changes & bugs number 10 & 15-18
This commit is contained in:
@ -25,7 +25,9 @@ class AuthenticationAPI {
|
||||
path: ApiEndpoints.forgetPassword,
|
||||
body: {"email": email, "password": password},
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {});
|
||||
expectedResponseModel: (json) {
|
||||
print('json=$json');
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
@ -66,7 +68,6 @@ class AuthenticationAPI {
|
||||
}
|
||||
|
||||
static Future verifyOtp({required String email, required String otpCode}) async {
|
||||
try {
|
||||
final response = await HTTPService().post(
|
||||
path: ApiEndpoints.verifyOtp,
|
||||
body: {"email": email, "type": "PASSWORD", "otpCode": otpCode},
|
||||
@ -79,17 +80,7 @@ class AuthenticationAPI {
|
||||
}
|
||||
});
|
||||
return response;
|
||||
} on DioException catch (e) {
|
||||
if (e.response != null) {
|
||||
if (e.response!.statusCode == 400) {
|
||||
final errorData = e.response!.data;
|
||||
String errorMessage = errorData['message'];
|
||||
return errorMessage;
|
||||
}
|
||||
} else {
|
||||
debugPrint('Error: ${e.message}');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static Future<List<RegionModel>> fetchRegion() async {
|
||||
|
Reference in New Issue
Block a user