Password validation for resetting password I have the following code to further validate passwords when creating/registering an account which is working fine.

However, when trying to use this same validation for resetting a password I am not getting any errors back?

Can anyone point me in the right direction...?

public function onBeforeSetPassword(Event $event)
{
    $user = $event-&gt;params['user'];
    $password = $event-&gt;params['password'];

    if (mb_strlen($password) &lt; 8)
    {
        $user-&gt;addError('password', 'Sorry but your password must be at least 8 characters.');
        $event-&gt;performAction = false;
    }

    if (!preg_match('/(\d.*[A-Z]|[A-Z].*\d)/', $password))
    {
        $user-&gt;addError('password', 'Sorry but your password must contain at least one uppercase letter and one number.');
        $event-&gt;performAction = false;
    }
}


On the template:

{% if account is defined and account.getErrors('password') %}
    {% include '_includes/formError' with { error : account.getErrors('password')|join('&lt;br&gt;') } %}
{% endif %}


Thanks.
I wasn't validating againts the field newPassword, only validating against password. Hence why I wasn't getting any feedback. Duplicating the validation for newPassword seems to have resolved this.