| @@ 53-66 (lines=14) @@ | ||
| 50 | throw new EmailNotFound; |
|
| 51 | } |
|
| 52 | ||
| 53 | if ($identity->matchKey($key) === false) { |
|
| 54 | $this->logger->warning('wrong password', [ |
|
| 55 | 'input' => [ |
|
| 56 | 'identifier' => $identifier, |
|
| 57 | 'key' => md5($key), |
|
| 58 | ], |
|
| 59 | 'account' => [ |
|
| 60 | 'user' => $identity->getUserId(), |
|
| 61 | 'identity' => $identity->getId(), |
|
| 62 | ], |
|
| 63 | ]); |
|
| 64 | ||
| 65 | throw new PasswordNotMatch; |
|
| 66 | } |
|
| 67 | ||
| 68 | $this->registerUsageOfIdentity($identity); |
|
| 69 | $cookie = $this->createCookieIdentity($identity); |
|
| @@ 282-296 (lines=15) @@ | ||
| 279 | ||
| 280 | $mapper = $this->mapperFactory->create(Mapper\PasswordIdentity::class); |
|
| 281 | ||
| 282 | if ($identity->matchKey($oldKey) === false) { |
|
| 283 | $this->logger->warning('wrong password', [ |
|
| 284 | 'input' => [ |
|
| 285 | 'user' => $userId, |
|
| 286 | 'old-key' => md5($oldKey), |
|
| 287 | 'new-key' => md5($newKey), |
|
| 288 | ], |
|
| 289 | 'account' => [ |
|
| 290 | 'user' => $identity->getUserId(), |
|
| 291 | 'identity' => $identity->getId(), |
|
| 292 | ], |
|
| 293 | ]); |
|
| 294 | ||
| 295 | throw new PasswordNotMatch; |
|
| 296 | } |
|
| 297 | ||
| 298 | $identity->setKey($newKey); |
|
| 299 | $mapper->store($identity); |
|