Fix type casting error (#278)

This commit is contained in:
Christiaan Goossens
2026-04-21 21:34:11 +02:00
committed by GitHub
parent 1e5b89fa32
commit fe706abdb5

View File

@@ -1,6 +1,5 @@
"""Welcome route to show the user the OIDC login button and give instructions.""" """Welcome route to show the user the OIDC login button and give instructions."""
from ast import List
import base64 import base64
import binascii import binascii
from urllib.parse import urlparse, parse_qs, unquote, urlencode from urllib.parse import urlparse, parse_qs, unquote, urlencode
@@ -29,7 +28,7 @@ class OIDCWelcomeView(HomeAssistantView):
self.has_other_auth_providers = options.get("has_other_auth_providers") self.has_other_auth_providers = options.get("has_other_auth_providers")
self.prefers_skipping = options.get("prefers_skipping") self.prefers_skipping = options.get("prefers_skipping")
async def _process_url(self, redirect_uri: str) -> List[str, bool]: async def _process_url(self, redirect_uri: str) -> tuple[str, bool]:
"""Processes the redirect URI to determine if we need setTokens and if this is mobile.""" """Processes the redirect URI to determine if we need setTokens and if this is mobile."""
# decodeURIComponent(btoa(...)) -> unquote first, then base64 decode # decodeURIComponent(btoa(...)) -> unquote first, then base64 decode
redirect_uri = base64.b64decode(unquote(redirect_uri), validate=True).decode( redirect_uri = base64.b64decode(unquote(redirect_uri), validate=True).decode(