diff --git a/hass_wh_triggers/app.py b/hass_wh_triggers/app.py index 9beed7f..2941717 100644 --- a/hass_wh_triggers/app.py +++ b/hass_wh_triggers/app.py @@ -48,11 +48,12 @@ app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}'.format( os.path.join(os.path.dirname(os.path.abspath(__name__)), 'webauthn.db')) -app.config.update( - SQLALCHEMY_TRACK_MODIFICATIONS=False, - #SERVER_NAME=ORIGIN.split('/')[-1], - #SESSION_COOKIE_SECURE=True -) +app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False +if ORIGIN != 'localhost': + app.config.update( + SERVER_NAME=ORIGIN.split('/')[-1], + SESSION_COOKIE_SECURE=True + ) sk = os.environ.get('FLASK_SECRET_KEY') app.secret_key = sk if sk else os.urandom(40) db.init_app(app)