Files
hass-oidc-auth/custom_components/auth_oidc/endpoints/welcome.py
Christiaan Goossens db4c6bcade Improved config options for OIDC (#9)
Added many new configuration options, including claim configuration and client_secret/confidential client support. Also enables user linking & creates person entries upon first sign in.
2024-12-28 21:37:00 +01:00

24 lines
676 B
Python

"""Welcome route to show the user the OIDC login button and give instructions."""
from aiohttp import web
from homeassistant.components.http import HomeAssistantView
from ..helpers import get_view
PATH = "/auth/oidc/welcome"
class OIDCWelcomeView(HomeAssistantView):
"""OIDC Plugin Welcome View."""
requires_auth = False
url = PATH
name = "auth:oidc:welcome"
def __init__(self, name: str) -> None:
self.name = name
async def get(self, _: web.Request) -> web.Response:
"""Receive response."""
view_html = await get_view("welcome", {"name": self.name})
return web.Response(text=view_html, content_type="text/html")