From 2364e1e652d79b68036bfe8b82e26bd24ce15fcf Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 5 Apr 2020 19:16:12 +0200 Subject: [PATCH] Remove old authentication (#1635) --- supervisor/api/proxy.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/supervisor/api/proxy.py b/supervisor/api/proxy.py index f7f6d74f8..4a285722a 100644 --- a/supervisor/api/proxy.py +++ b/supervisor/api/proxy.py @@ -123,21 +123,11 @@ class APIProxy(CoreSysAttributes): _LOGGER.error("Got unexpected response from HA WebSocket: %s", data) raise APIError() - if self.sys_homeassistant.refresh_token: - await self.sys_homeassistant.ensure_access_token() - await client.send_json( - { - "type": "auth", - "access_token": self.sys_homeassistant.access_token, - } - ) - else: - await client.send_json( - { - "type": "auth", - "api_password": self.sys_homeassistant.api_password, - } - ) + # Auth session + await self.sys_homeassistant.ensure_access_token() + await client.send_json( + {"type": "auth", "access_token": self.sys_homeassistant.access_token} + ) data = await client.receive_json()