Skip to content

Fix refresh_token middleware retry#32

Open
edance wants to merge 1 commit into
slashdotdash:masterfrom
edance:fix-refresh-token-retry
Open

Fix refresh_token middleware retry#32
edance wants to merge 1 commit into
slashdotdash:masterfrom
edance:fix-refresh-token-retry

Conversation

@edance

@edance edance commented Jan 4, 2023

Copy link
Copy Markdown

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant