Override http.trusted_networks by auth_provider.trusted_networks (#21844)

pull/21982/head
Jason Hu 2019-03-08 23:56:37 -08:00 committed by Paulus Schoutsen
parent 39749952ee
commit 1b4905ae5a
1 changed files with 8 additions and 0 deletions

View File

@ -211,6 +211,14 @@ class HomeAssistantHTTP:
"legacy_api_password support has been enabled. If you don't "
"require it, remove the 'api_password' from your http config.")
for prv in hass.auth.auth_providers:
if prv.type == 'trusted_networks':
# auth_provider.trusted_networks will override
# http.trusted_networks, http.trusted_networks will be
# removed from future release
trusted_networks = prv.trusted_networks
break
setup_auth(app, trusted_networks,
api_password if hass.auth.support_legacy else None)