Adjust reauth checks in august (#127320)
parent
9219339762
commit
e2eb986c7c
|
@ -12,7 +12,7 @@ from yalexs.authenticator_common import ValidationResult
|
||||||
from yalexs.const import BRANDS_WITHOUT_OAUTH, DEFAULT_BRAND, Brand
|
from yalexs.const import BRANDS_WITHOUT_OAUTH, DEFAULT_BRAND, Brand
|
||||||
from yalexs.manager.exceptions import CannotConnect, InvalidAuth, RequireValidation
|
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.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
|
|
||||||
|
@ -93,7 +93,6 @@ class AugustConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
self._aiohttp_session: aiohttp.ClientSession | None = None
|
self._aiohttp_session: aiohttp.ClientSession | None = None
|
||||||
self._user_auth_details: dict[str, Any] = {}
|
self._user_auth_details: dict[str, Any] = {}
|
||||||
self._needs_reset = True
|
self._needs_reset = True
|
||||||
self._mode: str | None = None
|
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
|
@ -147,7 +146,7 @@ class AugustConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle validation (2fa) step."""
|
"""Handle validation (2fa) step."""
|
||||||
if user_input:
|
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_reauth_validate(user_input)
|
||||||
return await self.async_step_user_validate(user_input)
|
return await self.async_step_user_validate(user_input)
|
||||||
|
|
||||||
|
@ -188,8 +187,6 @@ class AugustConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle configuration by re-auth."""
|
"""Handle configuration by re-auth."""
|
||||||
self._user_auth_details = dict(entry_data)
|
self._user_auth_details = dict(entry_data)
|
||||||
self._mode = "reauth"
|
|
||||||
self._needs_reset = True
|
|
||||||
return await self.async_step_reauth_validate()
|
return await self.async_step_reauth_validate()
|
||||||
|
|
||||||
async def async_step_reauth_validate(
|
async def async_step_reauth_validate(
|
||||||
|
|
Loading…
Reference in New Issue