|
- <?php
-
- namespace Lc\SovBundle\Controller\Security;
-
- use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
- use Symfony\Component\HttpFoundation\Response;
- use Symfony\Component\Routing\Annotation\Route;
- use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
-
- class SecurityController extends AbstractController
- {
-
- public function login(AuthenticationUtils $authenticationUtils): Response
- {
- if ($this->getUser()) {
- return $this->redirectToRoute('admin_dashboard');
- }
-
-
- $error = $authenticationUtils->getLastAuthenticationError();
-
- $lastUsername = $authenticationUtils->getLastUsername();
-
- return $this->render('@EasyAdmin/page/login.html.twig', [
-
- 'error' => $error,
- 'last_username' => $lastUsername,
-
-
-
-
-
-
-
- 'translation_domain' => 'admin',
-
-
-
-
- 'page_title' => '<img src="assets/img/laclic.png" >',
-
-
-
- 'csrf_token_intention' => 'authenticate',
-
-
- 'target_path' => $this->generateUrl('admin_dashboard'),
-
-
- 'username_label' => 'Your username',
-
-
- 'password_label' => 'Your password',
-
-
- 'sign_in_label' => 'Log in',
-
-
- 'username_parameter' => 'email',
-
-
- 'password_parameter' => 'password',
- ]);
- }
-
-
- public function logout()
- {
- throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
- }
- }
|