Adjust reauth checks in august (#127320)

pull/127331/head
epenet 2024-10-02 16:13:02 +02:00 committed by GitHub
parent 9219339762
commit e2eb986c7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 5 deletions

View File

@ -12,7 +12,7 @@ from yalexs.authenticator_common import ValidationResult
from yalexs.const import BRANDS_WITHOUT_OAUTH, DEFAULT_BRAND, Brand
from yalexs.manager.exceptions import CannotConnect, InvalidAuth, RequireValidation
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
@ -93,7 +93,6 @@ class AugustConfigFlow(ConfigFlow, domain=DOMAIN):
self._aiohttp_session: aiohttp.ClientSession | None = None
self._user_auth_details: dict[str, Any] = {}
self._needs_reset = True
self._mode: str | None = None
super().__init__()
async def async_step_user(
@ -147,7 +146,7 @@ class AugustConfigFlow(ConfigFlow, domain=DOMAIN):
) -> ConfigFlowResult:
"""Handle validation (2fa) step."""
if user_input:
if self._mode == "reauth":
if self.source == SOURCE_REAUTH:
return await self.async_step_reauth_validate(user_input)
return await self.async_step_user_validate(user_input)
@ -188,8 +187,6 @@ class AugustConfigFlow(ConfigFlow, domain=DOMAIN):
) -> ConfigFlowResult:
"""Handle configuration by re-auth."""
self._user_auth_details = dict(entry_data)
self._mode = "reauth"
self._needs_reset = True
return await self.async_step_reauth_validate()
async def async_step_reauth_validate(