mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-13 22:54:26 -04:00
Fix token refresh problems
This commit is contained in:
parent
b4b782c52c
commit
8c832b44cd
3 changed files with 11 additions and 7 deletions
|
@ -194,7 +194,9 @@ class HonAuth:
|
|||
return False
|
||||
if not await self._get_token(url):
|
||||
return False
|
||||
return await self._api_auth()
|
||||
|
||||
async def _api_auth(self):
|
||||
post_headers = {"id-token": self._id_token}
|
||||
data = self._device.get()
|
||||
async with self._session.post(
|
||||
|
@ -225,4 +227,4 @@ class HonAuth:
|
|||
data = await response.json()
|
||||
self._id_token = data["id_token"]
|
||||
self._access_token = data["access_token"]
|
||||
return True
|
||||
return await self._api_auth()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue