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

Remove duplicate oauth2 token validity check (#128419)

* remove duplicate validity check

* Apply suggestions from code review

* add leftover

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Christopher Fenner
2024-10-16 11:42:44 +02:00
committed by GitHub
parent 8ae8fa7ec9
commit 144454b8c3
12 changed files with 12 additions and 25 deletions

View File

@@ -49,7 +49,6 @@ class AsyncConfigEntryAuth(my_pypi_package.AbstractAuth):
async def async_get_access_token(self) -> str:
"""Return a valid access token."""
if not self._oauth_session.valid_token:
await self._oauth_session.async_ensure_token_valid()
await self._oauth_session.async_ensure_token_valid()
return self._oauth_session.token["access_token"]