Skip to content

Commit 31ced83

Browse files
committed
bug #20042 Update security.rst (JammyClarkie)
This PR was submitted for the 7.1 branch but it was merged into the 5.4 branch instead. Discussion ---------- Update security.rst If this form is submitted with an empty username or password, a 400 error will be thrown in a new page: The key "_password" must be a non-empty string. By adding "required" the user will instead get a more helpful "Please fill in this field." error on screen next to the appropriate box which is a much better experience. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `7.x` for features of unreleased versions). --> Commits ------- 1312099 Update security.rst
2 parents 3dc8ba5 + 1312099 commit 31ced83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,10 @@ Finally, create or update the template:
833833

834834
<form action="{{ path('app_login') }}" method="post">
835835
<label for="username">Email:</label>
836-
<input type="text" id="username" name="_username" value="{{ last_username }}">
836+
<input type="text" id="username" name="_username" value="{{ last_username }}" required>
837837

838838
<label for="password">Password:</label>
839-
<input type="password" id="password" name="_password">
839+
<input type="password" id="password" name="_password" required>
840840

841841
{# If you want to control the URL the user is redirected to on success
842842
<input type="hidden" name="_target_path" value="/account"> #}

0 commit comments

Comments
 (0)