BallStateCBER / commentaries-cake3

CBER Data Center: Weekly Commentary
0 stars 0 forks source link

Move password validation from controller to table #24

Open PhantomWatson opened 6 years ago

PhantomWatson commented 6 years ago

This code in UsersController.php:

if ($this->request->getData('password') != $this->request->getData('confirm_password')) {
    $this->Flash->error('Your passwords do not match. Please check your passwords and try again.');
}

should be turned into validation rules in UsersTable::validationDefault(). That will make the handling of validation more consistent and will make this rule actually prevent the password from being updated.

image