mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +00:00
Fix translation key in config flow of One-Time Password (OTP) integration (#120053)
This commit is contained in:
parent
4aa7a9faee
commit
f770fa0de0
@ -41,7 +41,7 @@ class TOTPConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
pyotp.TOTP(user_input[CONF_TOKEN]).now
|
||||
)
|
||||
except binascii.Error:
|
||||
errors["base"] = "invalid_code"
|
||||
errors["base"] = "invalid_token"
|
||||
except Exception:
|
||||
_LOGGER.exception("Unexpected exception")
|
||||
errors["base"] = "unknown"
|
||||
|
@ -42,7 +42,7 @@ async def test_form(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None:
|
||||
@pytest.mark.parametrize(
|
||||
("exception", "error"),
|
||||
[
|
||||
(binascii.Error, "invalid_code"),
|
||||
(binascii.Error, "invalid_token"),
|
||||
(IndexError, "unknown"),
|
||||
],
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user