diff --git a/homeassistant/components/life360/config_flow.py b/homeassistant/components/life360/config_flow.py index 5153e389d8b..4b59bcadf88 100644 --- a/homeassistant/components/life360/config_flow.py +++ b/homeassistant/components/life360/config_flow.py @@ -137,6 +137,12 @@ class Life360ConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_reauth_confirm(self, user_input: dict[str, Any]) -> FlowResult: """Handle reauthorization completion.""" + if not user_input: + return self.async_show_form( + step_id="reauth_confirm", + data_schema=vol.Schema(password_schema(self._password)), + errors={"base": "invalid_auth"}, + ) self._password = user_input[CONF_PASSWORD] return await self._async_verify("reauth_confirm") diff --git a/tests/components/life360/test_config_flow.py b/tests/components/life360/test_config_flow.py index b71b6638eb6..7eec67fc0cc 100644 --- a/tests/components/life360/test_config_flow.py +++ b/tests/components/life360/test_config_flow.py @@ -274,6 +274,15 @@ async def test_reauth_config_flow_login_error( key = list(schema)[0] assert key.default() == TEST_PW + # Simulate hitting RECONFIGURE button. + result = await hass.config_entries.flow.async_configure(result["flow_id"]) + await hass.async_block_till_done() + + assert result["type"] == data_entry_flow.FlowResultType.FORM + assert result["step_id"] == "reauth_confirm" + assert result["errors"] + assert result["errors"]["base"] == "invalid_auth" + # Simulate getting a new, valid password. life360_api.get_authorization.reset_mock(side_effect=True) life360_api.get_authorization.return_value = TEST_AUTHORIZATION_3