forked from peter/volvo2mqtt
handle missing refresh_token key in token file (#306)
This commit is contained in:
@@ -48,6 +48,10 @@ def authorize(renew_tokenfile=False):
|
|||||||
logging.warning("Detected corrupted token file, restarting auth process")
|
logging.warning("Detected corrupted token file, restarting auth process")
|
||||||
authorize(True)
|
authorize(True)
|
||||||
return
|
return
|
||||||
|
except KeyError:
|
||||||
|
logging.warning("Token file missing refresh_token, restarting auth process")
|
||||||
|
authorize(True)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
logging.info("Starting login with OTP")
|
logging.info("Starting login with OTP")
|
||||||
auth_session = requests.session()
|
auth_session = requests.session()
|
||||||
|
|||||||
Reference in New Issue
Block a user