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)