Ignore empty PLATFORMIO_AUTH_TOKEN

This commit is contained in:
Ivan Kravets
2020-06-04 13:57:56 +03:00
parent d7f4eb5955
commit 3c1b08daab

View File

@ -228,8 +228,8 @@ class AccountClient(RESTClient): # pylint:disable=too-many-public-methods
return response
def fetch_authentication_token(self):
if "PLATFORMIO_AUTH_TOKEN" in os.environ:
return os.environ["PLATFORMIO_AUTH_TOKEN"]
if os.environ.get("PLATFORMIO_AUTH_TOKEN"):
return os.environ.get("PLATFORMIO_AUTH_TOKEN")
auth = app.get_state_item("account", {}).get("auth", {})
if auth.get("access_token") and auth.get("access_token_expire"):
if auth.get("access_token_expire") > time.time():