src/Controller/IndexController.php line 39

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