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: async def get(self, _: web.Request) -> web.Response:
"""Receive response.""" """Receive response."""
redirect_uri = get_url("/auth/oidc/callback", self.force_https) try:
auth_url = await self.oidc_client.async_get_authorization_url(redirect_uri) 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: if auth_url:
return web.HTTPFound(auth_url) raise web.HTTPFound(auth_url)
except RuntimeError:
pass
view_html = await get_view( view_html = await get_view(
"error", "error",