Skip to content

Commit

Permalink
do not render hidden CSRF token forms with autocomplete set to off
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Dec 24, 2024
1 parent 264cff3 commit 092a893
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Extension/Csrf/Type/FormTypeCsrfExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function finishView(FormView $view, FormInterface $form, array $options):
$csrfForm = $factory->createNamed($options['csrf_field_name'], HiddenType::class, $data, [
'block_prefix' => 'csrf_token',
'mapped' => false,
'attr' => $this->fieldAttr + ['autocomplete' => 'off'],
'attr' => $this->fieldAttr,
]);

$view->children[$options['csrf_field_name']] = $csrfForm->createView($view);
Expand Down

0 comments on commit 092a893

Please sign in to comment.