src/Controller/Admin/SecurityController.php line 11

  1. <?php
  2. namespace App\Controller\Admin;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  6. class SecurityController extends AbstractController
  7. {
  8.     public function login(AuthenticationUtils $authenticationUtils): Response
  9.     {
  10.         $error        $authenticationUtils->getLastAuthenticationError();
  11.         $lastUsername $authenticationUtils->getLastUsername();
  12.         return $this->render('Admin/login.html.twig', ['last_username' => $lastUsername'error' => $error]);
  13.     }
  14.     public function logout(): Response
  15.     {
  16.         return $this->redirectToRoute('login', []);
  17.     }
  18. }