<?php
namespace AppBundle\Controller;
use CodersLab\Lms\Modules\Courses\Application\IInstanceRepository;
use \FOS\UserBundle\Controller\SecurityController as BaseController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
final class SecurityController extends BaseController
{
public function __construct(
AuthenticationUtils $authenticationUtils,
private IInstanceRepository $instanceRepository,
CsrfTokenManagerInterface $tokenManager = null
) {
parent::__construct($authenticationUtils, $tokenManager);
}
protected function renderLogin(array $data): Response
{
$data['show_registration'] = $this->instanceRepository
->countSelfRegisterInstances() > 0;
return parent::renderLogin($data);
}
}