|
@@ -14,19 +14,19 @@ use Symfony\Component\HttpFoundation\Request;
|
|
|
use Symfony\Component\Routing\Annotation\Route;
|
|
|
use AppBundle\Form\UserType;
|
|
|
use AppBundle\Entity\User;
|
|
|
+use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
|
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
|
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
|
|
+use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
|
|
|
|
|
class SecurityController extends Controller
|
|
|
{
|
|
|
- public function loginAction(Request $request)
|
|
|
+ public function loginAction(Request $request, AuthenticationUtils $authenticationUtils, AuthorizationCheckerInterface $authorizationChecker)
|
|
|
{
|
|
|
- if ($this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
|
|
|
+ if ($authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
|
|
|
return $this->redirectToRoute('videotheque_liste');
|
|
|
}
|
|
|
|
|
|
- $authenticationUtils = $this->get('security.authentication_utils');
|
|
|
-
|
|
|
return $this->render('@App/security/login.html.twig', array (
|
|
|
'last_username' => $authenticationUtils->getLastUsername(),
|
|
|
'error' => $authenticationUtils->getLastAuthenticationError()
|