mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Log if aiohttp hits error during IndieAuth (#21780)
* Log if aiohttp hits error during IndieAuth * Add content of redirect_url into error log Co-Authored-By: awarecan <awarecan@users.noreply.github.com>
This commit is contained in:
parent
3d8673dbf8
commit
31a4187cc0
@ -1,4 +1,5 @@
|
|||||||
"""Helpers to resolve client ID/secret."""
|
"""Helpers to resolve client ID/secret."""
|
||||||
|
import logging
|
||||||
import asyncio
|
import asyncio
|
||||||
from ipaddress import ip_address
|
from ipaddress import ip_address
|
||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
@ -9,6 +10,8 @@ from aiohttp.client_exceptions import ClientError
|
|||||||
|
|
||||||
from homeassistant.util.network import is_local
|
from homeassistant.util.network import is_local
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def verify_redirect_uri(hass, client_id, redirect_uri):
|
async def verify_redirect_uri(hass, client_id, redirect_uri):
|
||||||
"""Verify that the client and redirect uri match."""
|
"""Verify that the client and redirect uri match."""
|
||||||
@ -78,7 +81,8 @@ async def fetch_redirect_uris(hass, url):
|
|||||||
if chunks == 10:
|
if chunks == 10:
|
||||||
break
|
break
|
||||||
|
|
||||||
except (asyncio.TimeoutError, ClientError):
|
except (asyncio.TimeoutError, ClientError) as ex:
|
||||||
|
_LOGGER.error("Error while looking up redirect_uri %s: %s", url, ex)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Authorization endpoints verifying that a redirect_uri is allowed for use
|
# Authorization endpoints verifying that a redirect_uri is allowed for use
|
||||||
|
Loading…
x
Reference in New Issue
Block a user