Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Message parameter not exists in PasswordStrength constraint attribute #50651

Closed
@4d4ch4u32

Description

@4d4ch4u32

Symfony version(s) affected

6.3.0

Description

I just upgraded to Symfony 6.3 to use the new PasswordStrength constraint. In the docs I can see how to change the message that is issued when the password does not reach the minimum required score. But the parameter message is not existent for the attribute.

Link to documentation: https://symfony.com/doc/current/reference/constraints/PasswordStrength.html#message

How to reproduce

Using the attribute as documented, e.g.

use Symfony\Component\Validator\Constraints\PasswordStrength;

...

    #[PasswordStrength(
        minScore: PasswordStrength::STRENGTH_STRONG,
        message: 'A message for the user if the password is not strong enough.'
    )]
    private string $plainPassword;

Possible Solution

Adding the parameter to the attribute.

Additional Context

Just another point: the documentation about the requirements of each score (1-4) is a bit unclear in the current version of the documentation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions