src/Controller/SecurityController.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Controller; 
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; 
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  6. class SecurityController extends AbstractController {
  7.     public function login(AuthenticationUtils $authenticationUtils) {
  8.         $error = $authenticationUtils->getLastAuthenticationError(); 
  9.         $lastUsername = $authenticationUtils->getLastUsername(); 
  10.         return $this->render('security/login.html.twig', [
  11.             'lastUsername' => $lastUsername, 
  12.             'error' => $error
  13.         ]); 
  14.     }
  15.         
  16.     // /**
  17.     //  * @Route("/api/login", name="login_api", methods={"POST"})
  18.     //  */
  19.     // public function apiLogin() {
  20.     //     $user = $this->getUser(); 
  21.     //     return $this->json([
  22.     //         'username' => $user->getUsername(), 
  23.     //         'password' => $user->getPassword()
  24.     //     ]); 
  25.     // }
  26. }
  27. ?>