-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refreshing token doesn't work #14
Comments
ctmbl
added a commit
to ctmbl/sde-bot
that referenced
this issue
Jun 13, 2023
Refreshing token is incrorect and has been reported HelloAsso/helloasso-python#14
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: