|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
-
- namespace Lc\SovBundle\Controller\Security;
-
- use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
- use Symfony\Component\HttpFoundation\Request;
- use Symfony\Component\HttpFoundation\Response;
- use Symfony\Component\Routing\Annotation\Route;
- use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
-
- class SecurityAdminController extends AbstractController
- {
-
-
- public function login(AuthenticationUtils $authenticationUtils, Request $request): Response
- {
- if ($this->getUser()) {
- return $this->redirectToRoute('app_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/' . $this->get('parameter_bag')->get('app.admin.logo') . '" >',
-
-
-
- 'csrf_token_intention' => 'authenticate',
-
-
- 'target_path' => $this->generateUrl('app_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.'
- );
- }
- }
|