diff --git a/custom_components/auth_header/headers.py b/custom_components/auth_header/headers.py index 9759064..9acf09c 100644 --- a/custom_components/auth_header/headers.py +++ b/custom_components/auth_header/headers.py @@ -112,6 +112,7 @@ def async_validate_access(self, ip_addr: IPAddress) -> None: ip_addr in trusted_network for trusted_network in self.hass.http.trusted_proxies ): + _LOGGER.warning("Remote IP not in trusted proxies: %s", ip_addr) raise InvalidAuthError("Not in trusted_proxies") @@ -140,13 +141,13 @@ async def async_step_init( self._ip_address ) - except InvalidAuthError: - _LOGGER.debug("invalid auth") + except InvalidAuthError as exc: + _LOGGER.debug("invalid auth", exc_info=exc) return self.async_abort(reason="not_allowed") for user in self._available_users: if user.name == self._remote_user: return await self.async_finish({"user": user.id}) - _LOGGER.debug("no user") + _LOGGER.debug("no user found") return self.async_abort(reason="not_allowed")