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