Skip to content

Commit

Permalink
fix reauth
Browse files Browse the repository at this point in the history
  • Loading branch information
raman325 committed Mar 5, 2021
1 parent 8098a82 commit 2448ee4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/zoom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from logging import getLogger
from typing import Dict, List

from aiohttp.client_exceptions import ClientResponseError
from aiohttp.web_exceptions import HTTPUnauthorized
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntry
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, CONF_ID, CONF_NAME
Expand Down Expand Up @@ -110,7 +111,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):

try:
my_profile = await api.async_get_my_user_profile()
except HTTPUnauthorized:
except (HTTPUnauthorized, ClientResponseError) as err:
if isinstance(err, ClientResponseError) and err.status != 401:
return False

# If we are not authorized, we need to revalidate OAuth
if not [
flow
Expand Down

0 comments on commit 2448ee4

Please sign in to comment.