Make sure we check access token expiration (#15207)

* Make sure we check access token expiration

* Use correct access token websocket
This commit is contained in:
Paulus Schoutsen 2018-06-29 00:02:33 -04:00 committed by GitHub
parent 2205090795
commit 39971ee919
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 74 additions and 11 deletions

View file

@ -324,8 +324,9 @@ class ActiveConnection:
request, msg['api_password'])
elif 'access_token' in msg:
authenticated = \
msg['access_token'] in self.hass.auth.access_tokens
token = self.hass.auth.async_get_access_token(
msg['access_token'])
authenticated = token is not None
if not authenticated:
self.debug("Invalid password")