fix token exp check
This commit is contained in:
parent
3fca94ff29
commit
3cb164cae0
|
@ -23,7 +23,7 @@ class ReosCoordinator(DataUpdateCoordinator):
|
||||||
hass,
|
hass,
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
name="Reos Locks",
|
name="Reos Locks",
|
||||||
update_interval=timedelta(seconds=30),
|
update_interval=timedelta(hours=24),
|
||||||
)
|
)
|
||||||
self.api = api
|
self.api = api
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ class ReosApi:
|
||||||
|
|
||||||
def __is_token_valid(self, token: str) -> bool:
|
def __is_token_valid(self, token: str) -> bool:
|
||||||
try:
|
try:
|
||||||
jwt.decode(token, options={"verify_signature": False})
|
token = jwt.decode(token, options={"verify_signature": False, "verify_exp": True}, verify=True)
|
||||||
return True
|
return True
|
||||||
except jwt.ExpiredSignatureError:
|
except jwt.ExpiredSignatureError:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue