8000 Tweak login forms to enable double-submit CSRF protection · symfony/maker-bundle@dcd5357 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit dcd5357

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

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
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

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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)
0