craftpulse / craft-password-policy

Enforce a password policy on your Craft CMS users.
MIT License
27 stars 9 forks source link

Use craft-password-policy validation on empty passwords #8

Closed yiska closed 4 years ago

yiska commented 5 years ago

Allow the craft-password-policy validation to run on empty passwords so that the proper error messaging appears. This is a proposed fix for issue #7.

riasvdv commented 4 years ago

This would cause some forms to always fail (for example a "leave empty if you don't want to change your password" field.

There's not really a way for a plugin to check if the password is being changed other than checking this field, but you don't want to return a validation error if a user is just changing something other than their password.

If you find a different solution for this I'd gladly accept a new PR that implements a better way!