diff --git a/custom_components/auth_oidc/endpoints/injected_auth_page.py b/custom_components/auth_oidc/endpoints/injected_auth_page.py index 7112734..74d0945 100644 --- a/custom_components/auth_oidc/endpoints/injected_auth_page.py +++ b/custom_components/auth_oidc/endpoints/injected_auth_page.py @@ -64,7 +64,9 @@ async def frontend_injection(hass: HomeAssistant, sso_name: str) -> None: # Inject JS and register that route injection_js = "" sso_name_js = f"" - frontend_code = frontend_code.replace("", f"{injection_js}{sso_name_js}") + frontend_code = frontend_code.replace( + "", f"{injection_js}{sso_name_js}" + ) await hass.http.async_register_static_paths( [ diff --git a/custom_components/auth_oidc/endpoints/redirect.py b/custom_components/auth_oidc/endpoints/redirect.py index e203b38..5a0c1df 100644 --- a/custom_components/auth_oidc/endpoints/redirect.py +++ b/custom_components/auth_oidc/endpoints/redirect.py @@ -24,9 +24,8 @@ class OIDCRedirectView(HomeAssistantView): async def get(self, _: web.Request) -> web.Response: """Receive response.""" - redirect_uri = get_url("/auth/oidc/callback", self.force_https) - try: + redirect_uri = get_url("/auth/oidc/callback", self.force_https) auth_url = await self.oidc_client.async_get_authorization_url(redirect_uri) if auth_url: diff --git a/pyproject.toml b/pyproject.toml index 4c131b0..fc16b94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,3 +43,6 @@ packages = ["custom_components/auth_oidc"] asyncio_mode = "auto" addopts = "--cov=custom_components --cov-fail-under=0" log_level = "DEBUG" + +[tool.ruff] +target-version = "py313" \ No newline at end of file diff --git a/tests/test_hass_webserver.py b/tests/test_hass_webserver.py index 11d383d..67553d9 100644 --- a/tests/test_hass_webserver.py +++ b/tests/test_hass_webserver.py @@ -149,4 +149,4 @@ async def test_frontend_injection(hass: HomeAssistant, hass_client): text = await resp.text() assert "