src/User/UI/Http/Controller/Web/LoginUserController.php line 10
<?php
namespace App\User\UI\Http\Controller\Web;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
final class LoginUserController extends AbstractController
{
/**
* @param Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function __invoke(AuthenticationUtils $authenticationUtils)
{
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('security/login.html.twig', [
'last_username' => $lastUsername,
'error' => $error,
]);
}
}