Mercedes: Fix Refresh token handling #18880
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the latest API changes made by Mercedes, the refresh token is stable and is not changed anymore with every token refresh. (Not sure if this is a config bug on MB side as this will reduce the security level) - this PR will remove all the code that handled the rolling refresh token logic.
Now, the refresh token out of the config is the only source of true.
Setting store usage is removed. No need to delete of tokens in the db anymore...
User account is not needed anymore, for each car a separate refresh token is needed now. --> breaking change...
The new code was running in my environment for multiple hours and multiple restarts...
@andig: May I ask you to check it with your knowledge of evcc. Thx. I planned to remove the not needed access token in the config, but not sure why it is still visible in the frontend. (We need the refresh token only, as we request a new access token on restart.)
fixes: #18863