class Attio::OAuth::Client

def revoke_token(token)

Revoke a token
def revoke_token(token)
  token_value = token.is_a?(Token) ? token.access_token : token
  params = {
    token: token_value,
    client_id: client_id,
    client_secret: client_secret
  }
  # Use Faraday directly for OAuth endpoints
  conn = create_oauth_connection
  response = conn.post("/oauth/revoke") do |req|
    req.headers["Content-Type"] = "application/x-www-form-urlencoded"
    req.body = URI.encode_www_form(params)
  end
  response.success?
rescue => e
  # Log the error if debug mode is enabled
  warn "OAuth token revocation failed: #{e.message}" if Attio.configuration.debug
  false
end