checkToken function Null safety

Future<AuthenticationCheck> checkToken(
  1. String sessionToken
)

Returns an AuthenticationCheck class instance with data on whether the sessionToken is authenticated and the user's permissions.

Implementation

Future<AuthenticationCheck> checkToken(String sessionToken) async {
  var response = await checkTokenResponse(sessionToken);
  try {
    return AuthenticationCheck.fromJson(jsonDecode(response.body));
  } on Exception {
    throw MangadexServerException(jsonDecode(response.body));
  }
}