src/Controller/SecurityController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Breadcrumbs\Login;
  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 BaseController
  8. {
  9.     /**
  10.      * @Route("/", name="security.login")
  11.      * @param AuthenticationUtils $authenticationUtils
  12.      * @return Response
  13.      */
  14.     public function login(AuthenticationUtils $authenticationUtils)
  15.     {
  16.         if (null !== $this->getUser()) {
  17.             return $this->redirectToRoute('admin.dashboard');
  18.         }
  19.         $error $authenticationUtils->getLastAuthenticationError();
  20.         $lastUsername $authenticationUtils->getLastUsername();
  21.         $this->breadcrumbs()->create(new Login());
  22.         return $this->render('security/login.html.twig', [
  23.             'last_username' => $lastUsername,
  24.             'error'         => $error,
  25.         ]);
  26.     }
  27.     /**
  28.      * @Route("/logout", name="app.logout")
  29.      */
  30.     public function logout()
  31.     {
  32.     }
  33. }