mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-25 20:19:39 +00:00
change_pass
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user