XeroAPI / xero-ruby

Xero Ruby SDK for OAuth 2.0 generated from XeroAPI/Xero-OpenAPI
http://developer.xero.com/
MIT License
58 stars 91 forks source link

`token_request` method returning empty object when refreshing token #257

Open cameronbourgeois opened 1 year ago

cameronbourgeois commented 1 year ago

Recently we had a situation where the refresh_token_set method returned an empty object. This appears to happen when, for whatever reason, the response from the Faraday post request to /token in the token_request method has an empty or nil response body.

When refresh_token_set returned the empty object, we set this empty object in our database, thereby invalidating the connection.

I am curious as to what would cause the request to /token to return empty/nil in the first place, in order to work out what actions I need to take in my own codebase, and what to suggest could change (even just in the documentation) in this library to handle this situation.

cameronbourgeois commented 1 year ago

I've submitted a support request to Xero to get more information on why there was an empty response.