28 lines
726 B
PHP
28 lines
726 B
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
class SecurityController extends Controller
|
|
{
|
|
public function login(Request $req, AuthenticationUtils $auth_utils)
|
|
{
|
|
$params = [
|
|
'error' => false,
|
|
'last_username' => ''
|
|
];
|
|
|
|
$error = $auth_utils->getLastAuthenticationError();
|
|
$last_username = $auth_utils->getLastUsername();
|
|
|
|
$params = [
|
|
'error' => $error,
|
|
'last_username' => $last_username,
|
|
];
|
|
|
|
return $this->render('login.html.twig', $params);
|
|
}
|
|
}
|