* 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
23 lines
626 B
Python
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>",
|
|
)
|