mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-26 09:19:40 +00:00
fix loading issue seperate loading states between verify and resend Otp&&perevent user to send api if otp length !=6
This commit is contained in:
@ -270,7 +270,7 @@ class AuthCubit extends Cubit<AuthState> {
|
||||
|
||||
Future<bool> reSendOtp({bool? forget}) async {
|
||||
try {
|
||||
emit(AuthLoading());
|
||||
emit(ResendOtpLoading());
|
||||
await AuthenticationAPI.sendOtp(body: {
|
||||
'email': email,
|
||||
'type': forget == true ? 'PASSWORD' : 'VERIFICATION'
|
||||
@ -286,7 +286,10 @@ class AuthCubit extends Cubit<AuthState> {
|
||||
}
|
||||
|
||||
verifyOtp(bool isForgotPass) async {
|
||||
emit(AuthLoginLoading());
|
||||
if (otpCode.length != 6) {
|
||||
return;
|
||||
}
|
||||
emit(AuthOtpLoading());
|
||||
try {
|
||||
final response = await AuthenticationAPI.verifyPassCode(body: {
|
||||
'email': email,
|
||||
|
Reference in New Issue
Block a user