File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,34 @@ with the ``value`` attribute set to its true value only upon submission.
35
35
If you want to render your password field *with * the password value already
36
36
entered into the box, set this to false and submit the form.
37
37
38
+ ``hash_property_path ``
39
+ ~~~~~~~~~~~~~~~~~~~~~~
40
+
41
+ **type **: ``string `` **default **: ``null ``
42
+
43
+ .. versionadded :: 6.2
44
+
45
+ The ``hash_property_path `` option was introduced in Symfony 6.2.
46
+
47
+ If set, the password will be hashed using the
48
+ :doc: `PasswordHasher component </security/passwords >` and stored in the
49
+ specified property.
50
+
51
+ Data passed to the form must be a
52
+ :class: `Symfony\\ Component\\ Security\\ Core\\ User\\ PasswordAuthenticatedUserInterface `
53
+ object.
54
+
55
+ .. caution ::
56
+
57
+ To minimize the risk of leaking the plain password, this option can
58
+ only be used with the :ref: `"mapped" option <reference-form-password-mapped >`
59
+ set to ``false ``::
60
+
61
+ $builder->add('plainPassword', PasswordType::class, [
62
+ 'hash_property_path' => 'password',
63
+ 'mapped' => false,
64
+ ]);
65
+
38
66
Overridden Options
39
67
------------------
40
68
@@ -81,6 +109,8 @@ The default value is ``''`` (the empty string).
81
109
82
110
.. include :: /reference/forms/types/options/label_format.rst.inc
83
111
112
+ .. _reference-form-password-mapped :
113
+
84
114
.. include :: /reference/forms/types/options/mapped.rst.inc
85
115
86
116
.. include :: /reference/forms/types/options/required.rst.inc
You can’t perform that action at this time.
0 commit comments