src/Controller/EndUserModule/Security/AuthenticationController.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Controller\EndUserModule\Security;
  3. use App\Controller\EndUserModule\BaseEndUserController;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. class AuthenticationController extends BaseEndUserController
  9. {
  10.     /**
  11.      * @Route("", name="app_login")
  12.      */
  13.     public function login(AuthenticationUtils $authenticationUtilsRequest $request): Response
  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.         $userAgent $request->headers->get('User-Agent');
  20.         return $this->render('end_user_module/security/home.html.twig', ['last_username' => $lastUsername'error' => ($error != null)?$error->getMessage():null]);
  21.     }
  22.     /**
  23.      * @Route("/logout", name="app_logout")
  24.      */
  25.     public function logout(): Response
  26.     {
  27.     }
  28. }