src/Controller/SecurityController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  8. class SecurityController extends AbstractController
  9. {
  10.     /**
  11.      * @Route("/login", name="app_login")
  12.      */
  13.     public function login(AuthenticationUtils $authenticationUtils)
  14.     {
  15.         // get the login error if there is one
  16.         $error $authenticationUtils->getLastAuthenticationError();
  17.         // last username entered by the user
  18.         $lastUsername $authenticationUtils->getLastUsername();
  19.         return $this->render('security/login.html.twig', [
  20.             'last_username' => $lastUsername,
  21.             'error' => $error
  22.         ]);
  23.     }
  24.     /**
  25.      * @Route("/logout", name="app_logout")
  26.      */
  27.     public function logout(){
  28.     }
  29. }