src/Controller/BackOffice/SecurityController.php line 35

Open in your IDE?
  1. <?php
  2. namespace App\Controller\BackOffice;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  6. /**
  7.  * Class SecurityController
  8.  * @package App\Controller\BackOffice
  9.  */
  10. class SecurityController extends AbstractController
  11. {
  12.     /**
  13.      * @var AuthenticationUtils
  14.      */
  15.     private $authenticationUtils;
  16.     /**
  17.      * SecurityController constructor.
  18.      * @param AuthenticationUtils $authenticationUtils
  19.      */
  20.     public function __construct(AuthenticationUtils $authenticationUtils)
  21.     {
  22.         $this->authenticationUtils $authenticationUtils;
  23.     }
  24.     /**
  25.      * @Route(path="/login", methods={"GET", "POST"})
  26.      */
  27.     public function indexAction()
  28.     {
  29.         $error $this->authenticationUtils->getLastAuthenticationError();
  30.         $lastUsername $this->authenticationUtils->getLastUsername();
  31.         return $this->render(
  32.             'backOffice/security/login.html.twig',
  33.             [
  34.                 'lastUsername' => $lastUsername,
  35.                 'error' => $error,
  36.             ]
  37.         );
  38.     }
  39.     /**
  40.      * @Route("/logout", name="app_logout", methods={"GET"})
  41.      */
  42.     public function logout()
  43.     {
  44.     }
  45. }