<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController {
public function login(AuthenticationUtils $authenticationUtils) {
$error = $authenticationUtils->getLastAuthenticationError();
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('security/login.html.twig', [
'lastUsername' => $lastUsername,
'error' => $error
]);
}
// /**
// * @Route("/api/login", name="login_api", methods={"POST"})
// */
// public function apiLogin() {
// $user = $this->getUser();
// return $this->json([
// 'username' => $user->getUsername(),
// 'password' => $user->getPassword()
// ]);
// }
}
?>