strava icon indicating copy to clipboard operation
strava copied to clipboard

Fix refresh_token middleware retry

Open edance opened this issue 2 years ago • 0 comments

We were overriding the original Tesla.env with the response from the failed request. The failed request already had a status (401) and a body (json containing Authorization Error).

This change keeps the original Tesla.env and only updates the authorization header after using the refresh_token.

Let me know what you think about the tests. I wasn't sure how to test just the middleware so I wrote a test for the client instead.

edance avatar Jan 04 '23 04:01 edance