src/AppBundle/Controller/SecurityController.php line 27

Open in your IDE?
  1. <?php
  2. namespace AppBundle\Controller;
  3. use CodersLab\Lms\Modules\Courses\Application\IInstanceRepository;
  4. use \FOS\UserBundle\Controller\SecurityController as BaseController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
  7. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  8. final class SecurityController extends BaseController
  9. {
  10.     public function __construct(
  11.         AuthenticationUtils $authenticationUtils,
  12.         private IInstanceRepository $instanceRepository,
  13.         CsrfTokenManagerInterface $tokenManager null
  14.     ) {
  15.         parent::__construct($authenticationUtils$tokenManager);
  16.     }
  17.     protected function renderLogin(array $data): Response
  18.     {
  19.         $data['show_registration'] = $this->instanceRepository
  20.             ->countSelfRegisterInstances() > 0;
  21.         return parent::renderLogin($data);
  22.     }
  23. }