Potential minor bug in getNewPasswordErrors

2 posts by 2 authors in: Forums > CMS Builder
Last Post: Yesterday at 8:57pm   (RSS)

Hi Rob,

You want to treat $errors as an array inside the plugin hook function.  And, you can use addFilter() or the new Plugin::filter() method.

Plugin::filter('login_newPasswordErrors', function ($errors, $passwordText) {
    $errors[] = "Changing password is disabled"; // add an error
    return $errors;
});
This let's you manipulate the errors as needed.  So if you remove them all it will bypass any errors, or if you add one.

Let me know if that makes sense.
Dave Edis - Senior Developer
interactivetools.com