Add tests for password changing

This commit is contained in:
Dane Everitt 2018-07-15 11:44:18 -07:00
parent 6e9123af19
commit be2c76c24a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 32 additions and 10 deletions

View file

@ -21,7 +21,7 @@ class UpdateEmailRequest extends ClientApiRequest
// Verify password matches when changing password or email.
if (! password_verify($this->input('password'), $this->user()->password)) {
throw new InvalidPasswordProvidedException(trans('base.account.invalid_password'));
throw new InvalidPasswordProvidedException(trans('validation.internal.invalid_password'));
}
return true;

View file

@ -21,7 +21,7 @@ class UpdatePasswordRequest extends ClientApiRequest
// Verify password matches when changing password or email.
if (! password_verify($this->input('current_password'), $this->user()->password)) {
throw new InvalidPasswordProvidedException(trans('base.account.invalid_password'));
throw new InvalidPasswordProvidedException(trans('validation.internal.invalid_password'));
}
return true;

View file

@ -28,7 +28,7 @@ class AccountDataFormRequest extends FrontendUserFormRequest
// Verify password matches when changing password or email.
if (in_array($this->input('do_action'), ['password', 'email'])) {
if (! password_verify($this->input('current_password'), $this->user()->password)) {
throw new InvalidPasswordProvidedException(trans('base.account.invalid_password'));
throw new InvalidPasswordProvidedException(trans('validation.internal.invalid_password'));
}
}