Is there a reason why the refresh token is not used? #28
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
just went through the code and saw that it is using the Authorization code grant flow for authenticating with twitch, which is great!
But I am not sure, if I miss something here.
Your code checks, if the access token is still valid and if it isn't a signal is called but as far as I see, it does not try to get a new token by using the refresh token you got on authorization.
The authorize function also will always just newly authenticate to get an access token. If the file already exists (which should also include a refresh token) it could simply refresh the token, so the user does not have to open the browser everytime the game is started.
My take on this would be:
authorize function:
expired_token_check:
Thanks! I do not remember why I didn't use the refresh token, so I'm assuming that this was an overlook on my end. Your proposal looks good to me.
Has there been any movement or PR on this issue? I think this is a great idea and should be added to an upcoming release
Implemented in
0545456faa
for the initial connection. If the token becomes invalid while the program is running, users will have to refresh it themselves with the new refresh_access_token method when the user_token_invalid signal is emitted.Will keep this issue open until auto-refreshing after a failed API call is implemented as well.