src/Controller/Backend/SecurityController.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Backend;
  3. use Exception;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  8. #[Route('/admin')]
  9. class SecurityController extends AbstractController
  10. {
  11.     #[Route(path'/login'name'app_login')]
  12.     public function login(AuthenticationUtils $authenticationUtils): Response
  13.     {
  14.         $error $authenticationUtils->getLastAuthenticationError();
  15.         $lastUserName $authenticationUtils->getLastUsername();
  16.         return $this->render('backend/security/login.html.twig', [
  17.             'last_username' => $lastUserName,
  18.             'error' => $error
  19.         ]);
  20.     }
  21.     #[Route(path'/logout'name'app_logout')]
  22.     public function logout()
  23.     {
  24.         throw new Exception('FFCB logout');
  25.     }
  26. }