renew method

Future renew()

Implementation

Future<dynamic> renew() async {
  BaseOptions options = BaseOptions(
      baseUrl: url,
      validateStatus: (status) => status == 200,
      receiveDataWhenStatusError: true,
      connectTimeout: const Duration(seconds: 60000),
      receiveTimeout: const Duration(seconds: 60000));

  try {
    final dio = Dio(options);

    final response = await dio.get(
      '/oauth/token/refresh?token=${this.refreshToken}&isNew=true',
    );
    return response.data;
  } on DioException catch (e) {
    return e.response?.data ?? {};
  }
}