diff --git a/custom_components/auth_oidc/__init__.py b/custom_components/auth_oidc/__init__.py index 7fb452c..35c0cf6 100644 --- a/custom_components/auth_oidc/__init__.py +++ b/custom_components/auth_oidc/__init__.py @@ -6,6 +6,7 @@ from typing import OrderedDict from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant +from homeassistant.components.http import StaticPathConfig # Import and re-export config schema explictly # pylint: disable=useless-import-alias @@ -146,6 +147,16 @@ async def _setup_oidc_provider(hass: HomeAssistant, my_config: dict, display_nam force_https = features_config.get(FEATURES_FORCE_HTTPS, False) + await hass.http.async_register_static_paths( + [ + StaticPathConfig( + "/auth/oidc/static/style.css", + hass.config.path("custom_components/auth_oidc/static/style.css"), + cache_headers=True, + ), + ] + ) + hass.http.register_view( OIDCWelcomeView(provider, name, force_https, has_other_auth_providers) ) diff --git a/custom_components/auth_oidc/endpoints/injected_auth_page.py b/custom_components/auth_oidc/endpoints/injected_auth_page.py index 29d16b3..c3c2212 100644 --- a/custom_components/auth_oidc/endpoints/injected_auth_page.py +++ b/custom_components/auth_oidc/endpoints/injected_auth_page.py @@ -75,13 +75,8 @@ async def frontend_injection(hass: HomeAssistant, force_https: bool) -> None: StaticPathConfig( "/auth/oidc/static/injection.js", hass.config.path("custom_components/auth_oidc/static/injection.js"), - cache_headers=False, - ), - StaticPathConfig( - "/auth/oidc/static/style.css", - hass.config.path("custom_components/auth_oidc/static/style.css"), - cache_headers=False, - ), + cache_headers=True, + ) ] ) diff --git a/custom_components/auth_oidc/views/templates/base.html b/custom_components/auth_oidc/views/templates/base.html index 4772c1c..9b32695 100644 --- a/custom_components/auth_oidc/views/templates/base.html +++ b/custom_components/auth_oidc/views/templates/base.html @@ -6,7 +6,7 @@