<?php
/**
* @author Yenier Jimenez <yjmorales86@gmail.com>
*/
namespace App\Controller\Admin\Security\Login;
use App\Controller\Core\BaseController;
use LogicException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Component\Routing\Annotation\Route;
/**
* Controller to render the Login page.
*/
class LoginController extends BaseController
{
/**
* Creates the login page.
*
* @Route("/admin/login", name="bo_login")
*
* @param AuthenticationUtils $utils
*
* @return Response
*/
public function login(AuthenticationUtils $utils): Response
{
return $this->render('/admin/unauthenticated/security/login/login.html.twig', [
'lastUsername' => $utils->getLastUsername() ?? '',
'error' => $utils->getLastAuthenticationError() ?? '',
'recaptchaV3SiteKey' => $this->getParameter('operation_cpg_recaptcha_v3_site_key'),
]);
}
/**
* Route to log out the user.
*
* @Route("/admin/logout", name="bo_logout")
*/
public function logout(): void
{
throw new LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
}
}