src/Controller/User/SecurityController.php line 13

  1. <?php
  2. namespace App\Controller\User;
  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. class SecurityController extends AbstractController
  8. {
  9.     #[Route('/user/login'name'app_user_login')]
  10.     public function login(AuthenticationUtils $authenticationUtils): Response
  11.     {
  12.         if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
  13.             return $this->redirectToRoute('app_user_service_order');
  14.         }
  15.         return $this->render('pages/user/security/login.html.twig', [
  16.             'error' => $authenticationUtils->getLastAuthenticationError(),
  17.             'last_username' => $authenticationUtils->getLastUsername()
  18.         ]);
  19.     }
  20.     #[Route('/user/logout'name'app_user_logout'methods: ['GET'])]
  21.     public function logout()
  22.     {
  23.         //
  24.     }
  25. }