예제 #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();
 }
예제 #2
0
 public function verifyPassword(Account $account, string $password) : bool
 {
     return $this->passwordVerifyService->verifyPassword($account, $password);
 }