diff --git a/Classes/Controller/ProfileController.php b/Classes/Controller/ProfileController.php index a382902..ad48d9f 100644 --- a/Classes/Controller/ProfileController.php +++ b/Classes/Controller/ProfileController.php @@ -5,7 +5,7 @@ use Neos\Flow\Mvc\Controller\ActionController; use Neos\Flow\Security\Account; use Neos\Flow\Security\AccountRepository; -use Neos\Flow\Security\Authentication\AuthenticationManagerInterface; +use Neos\Flow\Security\Authentication\TokenAndProviderFactoryInterface; use Neos\Flow\Security\Authentication\Token\UsernamePassword; use Neos\Flow\Security\Authentication\TokenInterface; use Neos\Flow\Security\Context; @@ -31,11 +31,11 @@ class ProfileController extends ActionController */ protected $userRepository; - /** - * @Flow\Inject - * @var AuthenticationManagerInterface - */ - protected $authenticationManager; + /** + * @Flow\Inject + * @var TokenAndProviderFactoryInterface + */ + protected $tokenAndProviderFactory; /** * @Flow\Inject @@ -104,7 +104,7 @@ protected function getErrorFlashMessage() */ protected function setPassword(Account $account, $password) { - $tokens = $this->authenticationManager->getTokens(); + $tokens = $this->tokenAndProviderFactory->getTokens(); $indexedTokens = array(); foreach ($tokens as $token) { /** @var TokenInterface $token */ diff --git a/Classes/Domain/Validator/RegistrationFlowValidator.php b/Classes/Domain/Validator/RegistrationFlowValidator.php index c2d7854..84cf1e3 100644 --- a/Classes/Domain/Validator/RegistrationFlowValidator.php +++ b/Classes/Domain/Validator/RegistrationFlowValidator.php @@ -43,13 +43,13 @@ class RegistrationFlowValidator extends AbstractValidator */ protected function isValid($value) { - + /** @noinspection PhpUndefinedMethodInspection */ $existingAccount = $this->accountRepository->findOneByAccountIdentifier($value->getEmail()); if ($existingAccount) { $message = $this->translator->translateById('validations.registrationflow.email', [$value->getEmail()], null, null, 'Main', 'Sandstorm.UserManagement'); - $this->result->forProperty('email')->addError(new Error($message, 1336499566)); + $this->getResult()->forProperty('email')->addError(new Error($message, 1336499566)); } // If a custom validation service is registered, call its validate method to allow custom validations during registration @@ -57,15 +57,17 @@ protected function isValid($value) $instance = $this->objectManager->get(RegistrationFlowValidationServiceInterface::class); $instance->validateRegistrationFlow($value, $this); } + } - + /** * The custom validation service might need to access the result directly, so it is exposed here * * @return Result - */ - public function getResult() - { - return $this->result; - } + */ + public function getResult() + { + return parent::getResult(); + } + }