vendor/roothirsch/core-bundle/Security/Controller/SecurityController.php line 15

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\CoreBundle\Security\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  7. class SecurityController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/login", name="app_login")
  11.      */
  12.     public function login(AuthenticationUtils $authenticationUtils): Response
  13.     {
  14.         $error $authenticationUtils->getLastAuthenticationError();
  15.         $lastUsername $authenticationUtils->getLastUsername();
  16.         return $this->render(
  17.             '@EasyAdmin/page/login.html.twig', [
  18.             // parameters usually defined in Symfony login forms
  19.             'error' => $error,
  20.             'last_username' => $lastUsername,
  21.             // the string used to generate the CSRF token. If you don't define
  22.             // this parameter, the login form won't include a CSRF token
  23.             'csrf_token_intention' => 'authenticate',
  24.             // the URL users are redirected to after the login (default: path('easyadmin'))
  25.             'target_path' => '/',
  26.             // the label displayed for the username form field (the |trans filter is applied to it)
  27.             'username_label' => 'E-Mail-Adresse',
  28.             // the label displayed for the password form field (the |trans filter is applied to it)
  29.             'password_label' => 'Passwort',
  30.             // the label displayed for the Sign In form button (the |trans filter is applied to it)
  31.             'sign_in_label' => 'anmelden',
  32.             // the 'name' HTML attribute of the <input> used for the username field (default: '_username')
  33.             'username_parameter' => 'username',
  34.             // the 'name' HTML attribute of the <input> used for the password field (default: '_password')
  35.             'password_parameter' => 'password',
  36.         ]
  37.         );
  38.     }
  39.     /**
  40.      * @Route("/logout", name="app_logout")
  41.      */
  42.     public function logout()
  43.     {
  44.         throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
  45.     }
  46. }