diff --git a/homeassistant/components/config/auth_provider_homeassistant.py b/homeassistant/components/config/auth_provider_homeassistant.py index 44ac6f23e2d..a8421c4c0f6 100644 --- a/homeassistant/components/config/auth_provider_homeassistant.py +++ b/homeassistant/components/config/auth_provider_homeassistant.py @@ -124,7 +124,9 @@ async def websocket_change_password(hass, connection, msg): try: await provider.async_validate_login(username, msg["current_password"]) except auth_ha.InvalidAuth: - connection.send_error(msg["id"], "invalid_password", "Invalid password") + connection.send_error( + msg["id"], "invalid_current_password", "Invalid current password" + ) return await provider.async_change_password(username, msg["new_password"]) diff --git a/tests/components/config/test_auth_provider_homeassistant.py b/tests/components/config/test_auth_provider_homeassistant.py index 19568ff450b..6af3e6507d5 100644 --- a/tests/components/config/test_auth_provider_homeassistant.py +++ b/tests/components/config/test_auth_provider_homeassistant.py @@ -290,7 +290,7 @@ async def test_change_password_wrong_pw( result = await client.receive_json() assert not result["success"], result - assert result["error"]["code"] == "invalid_password" + assert result["error"]["code"] == "invalid_current_password" with pytest.raises(prov_ha.InvalidAuth): await auth_provider.async_validate_login("test-user", "new-pass")