Skip to content

Commit

Permalink
Use the documented API method to refresh auth token
Browse files Browse the repository at this point in the history
Fixes tuya#50
  • Loading branch information
bpfoster committed Dec 20, 2021
1 parent f6835d1 commit f4731b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tuya_iot/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

TUYA_ERROR_CODE_TOKEN_INVALID = 1010

TO_C_REFRESH_TOKEN_API_PRE = "/v1.0/iot-03/users/token/"
TO_C_REFRESH_TOKEN_API_PRE = "/v1.0/token/"

TO_C_CUSTOM_TOKEN_API = "/v1.0/iot-03/users/login"
TO_C_SMART_HOME_TOKEN_API = "/v1.0/iot-01/associated-users/actions/authorized-login"
Expand Down Expand Up @@ -154,7 +154,7 @@ def __refresh_access_token_if_need(self, path: str):
return

self.token_info.access_token = ""
response = self.post(
response = self.get(
TO_C_REFRESH_TOKEN_API_PRE + self.token_info.refresh_token
)

Expand Down

0 comments on commit f4731b1

Please sign in to comment.