Add tests for password changing
This commit is contained in:
parent
6e9123af19
commit
be2c76c24a
6 changed files with 32 additions and 10 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue