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

View File

@ -41,7 +41,6 @@ class AuthenticationAPI {
body: body, body: body,
showServerMessage: false, showServerMessage: false,
expectedResponseModel: (json) { expectedResponseModel: (json) {
print(json['data']);
return json['data']; return json['data'];
}); });
return response; return response;