disconnect method

Future<OAuth2Response> disconnect({
  1. dynamic httpClient,
})

Revokes the previously fetched token

Implementation

Future<OAuth2Response> disconnect({httpClient}) async {
  httpClient ??= http.Client();

  final tknResp = await tokenStorage.getToken(scopes ?? []);

  if (tknResp != null) {
    await tokenStorage.deleteToken(scopes ?? []);
    return await client.revokeToken(tknResp,
        clientId: clientId,
        clientSecret: clientSecret,
        httpClient: httpClient);
  } else {
    return OAuth2Response();
  }
}