repository = $repository; } /** * Find a matching user given a token * * @param Token $token * * @return null|User * * @throws NotAuthenticatedException In case the token is not authenticated. */ public function find(Token $token) { $infos = $token->getIdentity(); if ($infos->has(Identity::PROPERTY_EMAIL)) { return $this->repository->findByEmail($infos->get(Identity::PROPERTY_EMAIL)); } return null; } }