change_pass

This commit is contained in:
mohammad
2024-12-31 10:36:52 +03:00
parent 8be05fbd91
commit cff8c4728c
2 changed files with 2 additions and 12 deletions

View File

@ -82,7 +82,7 @@ class SecurityBloc extends Bloc<SecurityEvent, SecurityState> {
_remainingTime = 30;
var res = (await AuthenticationAPI.sendOtp(body: {
'email': HomeCubit.user!.email,
'type': 'VERIFICATION',
'type': 'PASSWORD',
if (HomeCubit.user!.regionUuid != null)
'regionUuid': HomeCubit.user!.regionUuid
}));
@ -160,11 +160,9 @@ class SecurityBloc extends Bloc<SecurityEvent, SecurityState> {
try {
final response = await AuthenticationAPI.verifyPassCode(body: {
'email': HomeCubit.user!.email!,
'type': 'VERIFICATION',
'type': 'PASSWORD',
'otpCode': otpCode
});
//929971
print('response=-=-=-${response}');
if (response['statusCode'] == 200) {
_timer?.cancel();
emit(SuccessForgetState());
@ -182,19 +180,12 @@ class SecurityBloc extends Bloc<SecurityEvent, SecurityState> {
ChangePasswordEvent event, Emitter<SecurityState> emit) async {
emit(LoadingForgetState());
try {
print('response=-=-=-${event.otpCode}');
final response = await AuthenticationAPI.forgetPassword(
email: HomeCubit.user!.email!,
otpCode: event.otpCode,
password: newPassword.text,
);
//537580
print('response=-=-=-${response}');
// if (response['statusCode'] == 200) {
// _timer?.cancel();
// emit(ChangedPassState());
// }
emit(ChangedPassState());
} on DioException catch (e) {
final errorData = e.response!.data;