src/Controller/Admin/Security/Login/LoginController.php line 31

Open in your IDE?
  1. <?php
  2. /**
  3.  * @author Yenier Jimenez <yjmorales86@gmail.com>
  4.  */
  5. namespace App\Controller\Admin\Security\Login;
  6. use App\Controller\Core\BaseController;
  7. use LogicException;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  10. use Symfony\Component\Routing\Annotation\Route;
  11. /**
  12.  * Controller to render the Login page.
  13.  */
  14. class LoginController extends BaseController
  15. {
  16.     /**
  17.      * Creates the login page.
  18.      *
  19.      * @Route("/admin/login", name="bo_login")
  20.      *
  21.      * @param AuthenticationUtils $utils
  22.      *
  23.      * @return Response
  24.      */
  25.     public function login(AuthenticationUtils $utils): Response
  26.     {
  27.         return $this->render('/admin/unauthenticated/security/login/login.html.twig', [
  28.             'lastUsername'       => $utils->getLastUsername() ?? '',
  29.             'error'              => $utils->getLastAuthenticationError() ?? '',
  30.             'recaptchaV3SiteKey' => $this->getParameter('operation_cpg_recaptcha_v3_site_key'),
  31.         ]);
  32.     }
  33.     /**
  34.      * Route to log out the user.
  35.      *
  36.      * @Route("/admin/logout", name="bo_logout")
  37.      */
  38.     public function logout(): void
  39.     {
  40.         throw new LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
  41.     }
  42. }