Skip to content

Commit 97636c3

Browse files
Tweak login forms to enable double-submit CSRF protection
1 parent a3b7f14 commit 97636c3

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/Resources/skeleton/authenticator/login_form.tpl.php

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
<input type="hidden" name="_csrf_token"
2626
value="{{ csrf_token('authenticate') }}"
27+
autocomplete="off"
28+
data-controller="csrf-protection"
2729
>
2830
<?php if($support_remember_me && !$always_remember_me): ?>
2931

src/Resources/skeleton/security/formLogin/login_form.tpl.php

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
<input type="hidden" name="_csrf_token"
2626
value="{{ csrf_token('authenticate') }}"
27+
autocomplete="off"
28+
data-controller="csrf-protection"
2729
>
2830

2931
{#

tests/fixtures/security/make-form-login/expected/login.html.twig

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
<input type="hidden" name="_csrf_token"
2424
value="{{ csrf_token('authenticate') }}"
25+
autocomplete="off"
26+
data-controller="csrf-protection"
2527
>
2628

2729
{#

tests/fixtures/security/make-form-login/expected/login_no_logout.html.twig

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
<input type="hidden" name="_csrf_token"
1818
value="{{ csrf_token('authenticate') }}"
19+
autocomplete="off"
20+
data-controller="csrf-protection"
1921
>
2022

2123
{#

0 commit comments

Comments
 (0)