Mark auth voluptuous schema fields as required (#57003)
This commit is contained in:
parent
79b10c43d8
commit
2d374d65b6
9 changed files with 35 additions and 25 deletions
|
@ -1,7 +1,6 @@
|
|||
"""Example auth provider."""
|
||||
from __future__ import annotations
|
||||
|
||||
from collections import OrderedDict
|
||||
from collections.abc import Mapping
|
||||
import hmac
|
||||
from typing import Any, cast
|
||||
|
@ -117,10 +116,13 @@ class ExampleLoginFlow(LoginFlow):
|
|||
user_input.pop("password")
|
||||
return await self.async_finish(user_input)
|
||||
|
||||
schema: dict[str, type] = OrderedDict()
|
||||
schema["username"] = str
|
||||
schema["password"] = str
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="init", data_schema=vol.Schema(schema), errors=errors
|
||||
step_id="init",
|
||||
data_schema=vol.Schema(
|
||||
{
|
||||
vol.Required("username"): str,
|
||||
vol.Required("password"): str,
|
||||
}
|
||||
),
|
||||
errors=errors,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue