Skip to content

Commit 8ed67d9

Browse files
committed
bug #363 Fill default username and password only when it's empty (bocharsky-bw)
This PR was merged into the master branch. Discussion ---------- Fill default username and password only when it's empty We lose `Security::LAST_USERNAME` on authorization failure. Commits ------- 53bdca5 Fill default username and password only when it's empty
2 parents 2f4220b + 53bdca5 commit 8ed67d9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/Resources/views/security/login.html.twig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,12 @@
9292

9393
<script>
9494
$(document).ready(function() {
95-
$('#username').val('anna_admin');
96-
$('#password').val('kitten');
95+
var usernameEl = $('#username');
96+
var passwordEl = $('#password');
97+
if (!usernameEl.val() && !passwordEl.val()) {
98+
usernameEl.val('anna_admin');
99+
passwordEl.val('kitten');
100+
}
97101
});
98102
</script>
99103
{% endblock %}

0 commit comments

Comments
 (0)