From 8aecd1c6490e513cda937c6016a1cba72c563ab9 Mon Sep 17 00:00:00 2001 From: Mia Miu Date: Sun, 23 Aug 2026 18:55:16 +1200 Subject: [PATCH] fix: include token type hint when revoking tokens --- lib/xero-ruby/api_client.rb | 3 ++- spec/api_client_spec.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index dc9d679a..cb98c7bb 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -226,7 +226,8 @@ def refresh_token_set(token_set) def revoke_token(token_set) token_set = token_set.with_indifferent_access data = { - token: token_set[:refresh_token] + token: token_set[:refresh_token], + token_type_hint: 'refresh_token' } return token_request(data, '/revocation') end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 617433b7..0f4ad221 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -137,6 +137,18 @@ expect(api_client.refresh_token_set(token_set)).to eq(token_set) end + it "#revoke_token" do + expect(api_client).to receive(:token_request).with( + { + token: token_set[:refresh_token], + token_type_hint: 'refresh_token' + }, + '/revocation' + ).and_return(token_set) + + expect(api_client.revoke_token(token_set)).to eq(token_set) + end + it "#connections" do expect(api_client).to receive(:call_api).and_return(connections) expect(api_client.config.base_url).to eq(nil)