-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[USER] Change password validation #3471
[USER] Change password validation #3471
Conversation
@@ -20,7 +20,7 @@ Feature: User account password change | |||
And I fill in "Confirmation" with "newpassword" | |||
And I press "Save changes" | |||
Then I should still be on my account password page | |||
And I should see "Wrong current password" | |||
And I should see "Wrong current password." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we agreed that matching texts should not contain dots etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I prefer to have them. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@umpirsky I'm talking about matching not about translations :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stloyd Me too. :)
Thanks @pjedrzejewski! I will use symfony constraint instead of custom one. |
<argument type="service" id="sylius.repository.customer" /> | ||
<tag name="validator.constraint_validator" alias="registered_user_validator" /> | ||
</service> | ||
<service id="validator.wrong.current_password" class="%sylius.user.validator.wrong_current_password%"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this sevice.
465b2e9
to
f4d3e5b
Compare
Thanks Łukasz! |
[USER] Change password validation
@@ -179,12 +182,12 @@ | |||
<service id="sylius.form.type.user_change_password" class="%sylius.form.type.user_change_password.class%"> | |||
<tag name="form.type" alias="sylius_user_change_password" /> | |||
</service> | |||
<service id="sylius.form.type.gender" class="Sylius\Bundle\UserBundle\Form\Type\GenderType"> | |||
<service id="sylius.form.type.gender" class="%sylius.form.type.gender.class%"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct, we should follow Symfony changes & not use class names as parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can always open a RFC about this. But for now, we have convention to use class names as parameters and I found it more appropriate to stay consistent then to change practise without discussion, just to follow some changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if we decide to change it, we do it everywhere. 👍 for the RFC.
Password validation was done inside a UserController. It wasn't translatable and it was hard to receive error message when you work with API, because error message was displayed in a flash message. I removed this part form a controller and move this logic to custom validatior.
I have also added two more parameters in a service.xml file to keep all class paths in a one place. It results probably in a BC break.