refresh method

  1. @Deprecated('This function is deprecated until further actions are taken my mangadex to introduce the new login methods')
Future<Login> refresh(
  1. String refreshToken
)
inherited

Endpoint used: POST /auth/refresh

Takes in a refresh token and returns a Login class instance containing the new token

Implementation

@Deprecated(
    'This function is deprecated until further actions are taken my mangadex to introduce the new login methods')
Future<Login> refresh(String refreshToken) async {
  var response = await getRefreshResponse(refreshToken);
  try {
    return Login.fromJson(jsonDecode(response.body));
  } catch (e) {
    throw MangadexServerException(jsonDecode(response.body));
  }
}