8000 Generate data-controller="csrf-protection" on CSRF fields by nicolas-grekas · Pull Request #1643 · symfony/maker-bundle · GitHub
[go: up one dir, main page]

Skip to content

Generate data-controller="csrf-protection" on CSRF fields #1643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Generate data-controller="csrf-protection" on CSRF fields
  • Loading branch information
nicolas-grekas committed Jan 6, 2025
commit b13f0fb68c51c7c4b84432e56b90fcad8a8042bf
5 changes: 1 addition & 4 deletions templates/authenticator/login_form.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
<input type="<?= $username_is_email ? 'email' : 'text'; ?>" value="{{ last_username }}" name="<?= $username_field; ?>" id="input<?= ucfirst($username_field); ?>" class="form-control" autocomplete="<?= $username_is_email ? 'email' : 'username'; ?>" required autofocus>
<label for="inputPassword">Password</label>
<input type="password" name="password" id="inputPassword" class="form-control" autocomplete="current-password" required>

<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">
<?php if($support_remember_me && !$always_remember_me): ?>

<div class="checkbox mb-3">
Expand Down
5 changes: 1 addition & 4 deletions templates/security/formLogin/login_form.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
<input type="<?= $username_is_email ? 'email' : 'text'; ?>" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="<?= $username_is_email ? 'email' : 'username'; ?>" required autofocus>
<label for="password">Password</label>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>

<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">

{#
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
<label for="password">Password</label>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>

<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">

{#
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
<label for="password">Password</label>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>

<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">

{#
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
Expand Down
Loading
0