resetPassword method

Future<void> resetPassword()

Initiates the reset password process for the user with the given username

Implementation

Future<void> resetPassword() async {
  if (!_formKey.currentState!.validate()) {
    return;
  }

  _setIsBusy(true);

  TextInput.finishAutofillContext(shouldSave: true);

  final resetPasswordData = AuthResetPasswordData(username: _username.trim());
  _authBloc.add(AuthResetPassword(resetPasswordData));
  await nextBlocEvent(
    where: (state) => state is UnauthenticatedState,
  );
  _setIsBusy(false);
}