Fix 500 on redirect path (#201)

* Fix 500 on redirect path

Co-authored-by: anntnzrb <anntnzrb@proton.me>
This commit is contained in:
Christiaan Goossens
2026-02-06 11:07:46 +01:00
committed by Christiaan Goossens
parent f53c16b20e
commit 653c716ea8

View File

@@ -24,11 +24,14 @@ class OIDCRedirectView(HomeAssistantView):
async def get(self, _: web.Request) -> web.Response:
"""Receive response."""
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:
return web.HTTPFound(auth_url)
raise web.HTTPFound(auth_url)
except RuntimeError:
pass
view_html = await get_view(
"error",