fix authentication error message

This commit is contained in:
2018-07-09 19:09:26 +02:00
parent 6ab86ac4fd
commit 2bb3b332f3
2 changed files with 18 additions and 6 deletions

View File

@@ -5,10 +5,21 @@ namespace Chill\MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class LoginController extends Controller
{
/**
*
* @var AuthenticationUtils
*/
protected $helper;
public function __construct(AuthenticationUtils $helper)
{
$this->helper = $helper;
}
/**
* Show a login form
*
@@ -17,11 +28,10 @@ class LoginController extends Controller
*/
public function loginAction(Request $request)
{
$helper = $this->get('security.authentication_utils');
return $this->render('ChillMainBundle:Login:login.html.twig', array(
'last_username' => $helper->getLastUsername(),
'error' => $helper->getLastAuthenticationError()
'last_username' => $this->helper->getLastUsername(),
'error' => $this->helper->getLastAuthenticationError()
));
}