public function onRegistrationCompleted(FilterUserResponseEvent $event) { $user = $event->getUser(); $auth = new Authorization(); $auth->setPerson($user); $auth->setClient($this->clientRepository->findOneBy(['uid' => $this->defaultClientUid])); $auth->setScope(explode(' ', $this->lcSupportedScopes)); $this->em->persist($auth); $this->em->flush(); $this->mailer->sendConfirmationEmailMessage($user); if (strlen($user->getPassword()) == 0) { // TODO: DEPRECATE NOTIFICATIONS // TODO: create an optional task offering users to set a password //$this->notificationsHelper->enforceEmptyPasswordNotification($user); } $this->registerRequestedScope->clearRequestedScope($event->getRequest()); }