You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
The HaApiV5 which inherit from ApiV5Client which itself is composed of the OAuth2Api is supposed to handled the token refreshing itself.
In ApiV5Client.call:
The
HaApiV5
which inherit fromApiV5Client
which itself is composed of theOAuth2Api
is supposed to handled the token refreshing itself.In
ApiV5Client.call
:A call is
try
ed and if an Exception is raised it refresh/get the token it if it exists/is None.However it returns itself, recursively, after refreshing, but with the old headers which embeds the old token, since the line
because
prepare_request
returns the token in theheaders
object.Now in
prepare_request
the new token is gotten inbut then overwritten by the old one stored in
headers
thus the old token is used the header request and it fails its task of handling token refresh
This diff should fix the problem:
because it doesn't overwrite the
header
var and then when return recursively it returns the user-defined headers, not embedding the old token.The text was updated successfully, but these errors were encountered: