logout method

Future<void> logout()

Implementation

Future<void> logout() async {
  final credentials = _credentials;
  if (credentials == null) {
    return;
  }
  _credentials = null;

  await _clearCredentials();

  try {
    await http.post(
      logoutEndpoint,
      headers: {'Content-Type': 'application/x-www-form-urlencoded'},
      body: {
        'client_id': clientId,
        'refresh_token': credentials.refreshToken,
      },
    );
  } catch (_) {}
}