This commit is contained in:
Otto Winter 2018-11-23 21:41:21 +01:00
parent 8433856fc9
commit a218e96fba
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E
4 changed files with 8 additions and 4 deletions

View file

@ -44,11 +44,11 @@ HASSIO_MQTT_CONFIG = {}
# pylint: disable=abstract-method
class BaseHandler(tornado.web.RequestHandler):
def is_authenticated(self):
if not USING_HASSIO_AUTH and not USING_PASSWORD:
return True
if USING_HASSIO_AUTH or USING_PASSWORD:
return self.get_secure_cookie('authenticated') == 'yes'
return True
# pylint: disable=abstract-method, arguments-differ
class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
@ -59,7 +59,7 @@ class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
def on_message(self, message):
if USING_HASSIO_AUTH or USING_PASSWORD:
if not self.get_secure_cookie('authenticated') == 'yes':
if self.get_secure_cookie('authenticated') != 'yes':
return
if self.proc is not None:
return

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -17,6 +17,8 @@
<script src="/static/materialize-stepper.min.js"></script>
<link rel="shortcut icon" href="{{ static_url('favicon.ico') }}">
<style>
nav .brand-logo {
margin-left: 48px;

View file

@ -17,6 +17,8 @@
<script src="/static/materialize-stepper.min.js"></script>
<link rel="shortcut icon" href="{{ static_url('favicon.ico') }}">
<style>
nav .brand-logo {
margin-left: 48px;