Ejemplo n.º 1
0
 public function changePassword(Account $account, string $oldPassword, string $newPassword) : string
 {
     if (!$this->passwordVerifyService->verifyPassword($account, $oldPassword)) {
         throw new InvalidOldPasswordException('Invalid old password');
     }
     $account->setPassword($this->passwordVerifyService->generatePassword($newPassword));
     $this->accountRepository->saveAccount($account);
     return $account->getAPIKey();
 }