<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
/**
* Class SecurityController
*/
class SecurityController extends AbstractController
{
/**
* @Route("/login", name="login")
*
* @param AuthenticationUtils $authUtils
*
* @return Response
*/
public function login(AuthenticationUtils $authUtils): Response
{
$response = $this->render('security/login.twig', array(
'last_username' => $authUtils->getLastUsername(),
'error' => $authUtils->getLastAuthenticationError(),
));
$response->setStatusCode(Response::HTTP_UNAUTHORIZED);
return $response;
}
}