Use password field type for the login form password
This commit is contained in:
@@ -94,10 +94,11 @@ class InvalidFieldError(Exception):
|
||||
class FormDescription(object):
|
||||
"""Generate a JSON representation of a form. """
|
||||
|
||||
ALLOWED_TYPES = ["text", "select", "textarea", "checkbox"]
|
||||
ALLOWED_TYPES = ["text", "select", "textarea", "checkbox", "password"]
|
||||
|
||||
ALLOWED_RESTRICTIONS = {
|
||||
"text": ["min_length", "max_length"],
|
||||
"password": ["min_length", "max_length"],
|
||||
}
|
||||
|
||||
def __init__(self, method, submit_url):
|
||||
|
||||
@@ -596,7 +596,7 @@ class LoginSessionViewTest(ApiTestCase):
|
||||
{
|
||||
"name": "password",
|
||||
"default": "",
|
||||
"type": "text",
|
||||
"type": "password",
|
||||
"required": True,
|
||||
"label": "Password",
|
||||
"placeholder": "",
|
||||
|
||||
@@ -81,6 +81,7 @@ class LoginSessionView(APIView):
|
||||
form_desc.add_field(
|
||||
"password",
|
||||
label=_(u"Password"),
|
||||
field_type="password",
|
||||
restrictions={
|
||||
"min_length": account_api.PASSWORD_MIN_LENGTH,
|
||||
"max_length": account_api.PASSWORD_MAX_LENGTH,
|
||||
|
||||
Reference in New Issue
Block a user