File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,28 @@ with the ``value`` attribute set to its true value only upon submission.
3535If you want to render your password field *with * the password value already
3636entered into the box, set this to false and submit the form.
3737
38+ ``hash_mapping ``
39+ ~~~~~~~~~~~~~~~~
40+
41+ **type **: ``string `` **default **: ``null ``
42+
43+ If set, the password will be hashed using the PasswordHasher component and
44+ stored in the specified property.
45+
46+ Data passed to the form must be a ``PasswordAuthenticatedUserInterface `` object.
47+
48+ .. caution ::
49+
50+ To minimize the risk of leaking the plain password,
51+ this option can only be used with the ``mapped `` option set to ``false ``.
52+
53+ $builder->add('plainPassword', PasswordType::class, [
54+ 'hash_mapping' => 'password',
55+ 'mapped' => false,
56+ ]);
57+
58+ See the :ref: `"mapped" option documentation <reference-form-mapped >`.
59+
3860Overridden Options
3961------------------
4062
@@ -81,6 +103,8 @@ The default value is ``''`` (the empty string).
81103
82104.. include :: /reference/forms/types/options/label_format.rst.inc
83105
106+ .. _reference-form-mapped :
107+
84108.. include :: /reference/forms/types/options/mapped.rst.inc
85109
86110.. include :: /reference/forms/types/options/required.rst.inc
You can’t perform that action at this time.
0 commit comments