tryGetToken method

Future<void> tryGetToken()

Implementation

Future<void> tryGetToken() async {
  var count = 1;

  Timer.periodic(const Duration(seconds: 5), (Timer timer) async {
    await checkStatusManager.getUserData(otpCode: randomString);
    count++;

    if (count == 12) {
      logger.warn(
        'The CLI operation timed out. Please try again or check your network connection.',
      );
      timer.cancel();
      exit(0);
    }
  });
}