revoke method

  1. @override
Future<HttpResult<AuthRevokeResponse>> revoke({
  1. required String accessToken,
  2. required String clientId,
})
override

Revoke the accessToken acquired during the OAuth process using the clientId indicated.

For more information, please read the link below: https://dev.twitch.tv/docs/authentication#revoking-access-tokens

Implementation

@override
Future<HttpResult<AuthRevokeResponse>> revoke({
  required String accessToken,
  required String clientId,
}) async {
  return await client.makeGet<AuthRevokeResponse>(
    TwitchAuthenticationConstants.revokeEndpoint,
    queryParameters: {
      TwitchAuthenticationConstants.clientIdParam: clientId,
      TwitchAuthenticationConstants.tokenParam: accessToken,
    },
    convertBodyFunc: (response) => AuthRevokeResponse.fromHttpResponse(
      response.statusCode,
      response.body,
    ),
  );
}