tuya-iot-python-sdk icon indicating copy to clipboard operation
tuya-iot-python-sdk copied to clipboard

Token is never refreshed

Open umonaca opened this issue 3 years ago • 2 comments

https://github.com/tuya/tuya-iot-python-sdk/blob/83f1e999d75ef87b2170ffbbb239ca8651dab0c3/tuya_iot/openapi.py#L144

But is_connect() never check if the token is expired.

Besides, this bug needs more than a one-line fix. You have another hidden problem in your code:

__request() => __refresh_access_token_if_need() => post() => __request() => __refresh_access_token_if_need()

Currently the loop breaks because of is_connect() == True. However, you should be aware that once you fix the bug mentioned above, you must also check whether path.startswith(TO_C_REFRESH_TOKEN_API).

umonaca avatar Oct 20 '21 21:10 umonaca

Any update on that ?

aambroze avatar Jan 25 '23 20:01 aambroze

Any update on that ?

No, there are several pull requests that would solve this issue, however, any of developers won't even reject them.

awm1 avatar Feb 03 '23 07:02 awm1