| @@ 293-303 (lines=11) @@ | ||
| 290 | ||
| 291 | public function useOneTimeIdentity(Entity\OneTimeIdentity $identity, $key) |
|
| 292 | { |
|
| 293 | if ($identity->matchKey($key) === false) { |
|
| 294 | $this->logger->notice('wrong key', [ |
|
| 295 | 'input' => [ |
|
| 296 | 'key' => md5($key), |
|
| 297 | ], |
|
| 298 | 'user' => [ |
|
| 299 | 'account' => $identity->getAccountId(), |
|
| 300 | 'identity' => $identity->getId(), |
|
| 301 | ], |
|
| 302 | ]); |
|
| 303 | } |
|
| 304 | ||
| 305 | $mapper = $this->mapperFactory->create(Mapper\OneTimeIdentity::class); |
|
| 306 | $mapper->store($identity); |
|
| @@ 47-59 (lines=13) @@ | ||
| 44 | */ |
|
| 45 | public function markForReset(Entity\EmailIdentity $identity) |
|
| 46 | { |
|
| 47 | if ($identity->getStatus() === Entity\Identity::STATUS_NEW) { |
|
| 48 | $this->logger->notice('identity not verified', [ |
|
| 49 | 'input' => [ |
|
| 50 | 'email' => $identity->getEmailAddress(), |
|
| 51 | ], |
|
| 52 | 'user' => [ |
|
| 53 | 'account' => $identity->getAccountId(), |
|
| 54 | 'identity' => $identity->getId(), |
|
| 55 | ], |
|
| 56 | ]); |
|
| 57 | ||
| 58 | throw new IdentityNotVerified; |
|
| 59 | } |
|
| 60 | ||
| 61 | $identity->generateToken(); |
|
| 62 | $identity->setTokenAction(Entity\Identity::ACTION_RESET); |
|