Files
hass-oidc-auth/custom_components/auth_oidc/endpoints/welcome.py
Christiaan Goossens b4a08b17ab Code quality improvements (v0.2.0-pre-alpha) (#5)
* Bumped version to 0.2.0
* Implemented Github Actions for HACS, Hassfest, Linting
* Improved code quality (compliant with the linter now)
* Added link to the finish page to automatically login on the same device/browser
2024-12-27 00:20:38 +01:00

23 lines
626 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
PATH = "/auth/oidc/welcome"
class OIDCWelcomeView(HomeAssistantView):
"""OIDC Plugin Welcome View."""
requires_auth = False
url = PATH
name = "auth:oidc:welcome"
async def get(self, _: web.Request) -> web.Response:
"""Receive response."""
return web.Response(
headers={"content-type": "text/html"},
text="<h1>OIDC Login</h1><p><a href='/auth/oidc/redirect'>Login with OIDC</a></p>",
)