mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-25 09:07:56 +00:00
region and access_management ui
This commit is contained in:
@@ -40,10 +40,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
if (_timer != null && _timer!.isActive) {
|
||||
return;
|
||||
}
|
||||
_remainingTime = 60;
|
||||
add(UpdateTimerEvent(
|
||||
remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
debugPrint('_remainingTime=$_remainingTime');
|
||||
_remainingTime = 1;
|
||||
add(UpdateTimerEvent(remainingTime: _remainingTime, isButtonEnabled: false));
|
||||
_remainingTime = (await AuthenticationAPI.sendOtp(email: forgetEmailController.text,regionUuid: regionUuid))!;
|
||||
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
_remainingTime--;
|
||||
@@ -125,7 +123,6 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
} catch (failure) {
|
||||
validate='Something went wrong';
|
||||
emit(const LoginFailure(error: 'Something went wrong'));
|
||||
// emit(LoginFailure(error: failure.toString()));
|
||||
return;
|
||||
}
|
||||
if (token.accessTokenIsNotEmpty) {
|
||||
@@ -187,6 +184,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
return 'Email is required';
|
||||
} else if (!RegExp(r'^[^@]+@[^@]+\.[^@]+').hasMatch(value)) {
|
||||
return 'Enter a valid email address';
|
||||
}else if (regionUuid=='') {
|
||||
return 'Please select your region';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user