Commit 7f228db51f4ec7a3fa837ea571571e6dc40907f6
Committed by
GitHub
Exists in
2.9
and in
2 other branches
Merge pull request #8559 from portabilis/hotfix-cad-user
Ajusta lógica para permitir cadastrar um novo usuário sem validar a senha antiga
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/Services/ValidateUserPasswordService.php
... | ... | @@ -17,7 +17,7 @@ class ValidateUserPasswordService |
17 | 17 | $this->hash = $hash; |
18 | 18 | } |
19 | 19 | |
20 | - public function execute(string $newPassword, ?string $oldPassword) | |
20 | + public function execute(string $newPassword, string $oldPassword = null) | |
21 | 21 | { |
22 | 22 | try { |
23 | 23 | $this->validate($newPassword, $oldPassword); |
... | ... | @@ -36,7 +36,7 @@ class ValidateUserPasswordService |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | - public function validate(string $newPassword, ?string $oldPassword) | |
39 | + public function validate(string $newPassword, $oldPassword = null) | |
40 | 40 | { |
41 | 41 | if ($this->hash->check($newPassword, $oldPassword)){ |
42 | 42 | throw new \Exception('A senha informada foi usada recentemente. Por favor, escolha outra.'); | ... | ... |