1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Add is_admin check to check configuration API (#97788)

This commit is contained in:
Franck Nijhof
2023-08-04 19:25:01 +02:00
committed by GitHub
parent 66cb407e4f
commit b286da211a
3 changed files with 21 additions and 2 deletions

View File

@@ -744,10 +744,10 @@ def hass_client(
) -> ClientSessionGenerator:
"""Return an authenticated HTTP client."""
async def auth_client() -> TestClient:
async def auth_client(access_token: str | None = hass_access_token) -> TestClient:
"""Return an authenticated client."""
return await aiohttp_client(
hass.http.app, headers={"Authorization": f"Bearer {hass_access_token}"}
hass.http.app, headers={"Authorization": f"Bearer {access_token}"}
)
return auth_client