revokeToken method

Future<OAuth2Response> revokeToken(
  1. AccessTokenResponse tknResp, {
  2. String? clientId,
  3. String? clientSecret,
  4. dynamic httpClient,
})

Revokes both the Access and the Refresh tokens in the provided tknResp

Implementation

Future<OAuth2Response> revokeToken(AccessTokenResponse tknResp,
    {String? clientId, String? clientSecret, httpClient}) async {
  var tokenRevocationResp = await revokeAccessToken(tknResp,
      clientId: clientId, clientSecret: clientSecret, httpClient: httpClient);
  if (tokenRevocationResp.isValid()) {
    tokenRevocationResp = await revokeRefreshToken(tknResp,
        clientId: clientId,
        clientSecret: clientSecret,
        httpClient: httpClient);
  }

  return tokenRevocationResp;
}