mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
switch loginController to symfony3
This commit is contained in:
parent
06bff38701
commit
2bcaaac60c
@ -17,29 +17,12 @@ class LoginController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function loginAction(Request $request)
|
public function loginAction(Request $request)
|
||||||
{
|
{
|
||||||
|
$helper = $this->get('security.authentication_utils');
|
||||||
$session = $request->getSession();
|
|
||||||
|
|
||||||
if ($request->attributes->has(SecurityContextInterface::AUTHENTICATION_ERROR)) {
|
|
||||||
$error = $request->attributes->get(
|
|
||||||
SecurityContextInterface::AUTHENTICATION_ERROR
|
|
||||||
);
|
|
||||||
} elseif (null !== $session && $session->has(SecurityContextInterface::AUTHENTICATION_ERROR)) {
|
|
||||||
$error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
|
|
||||||
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
|
|
||||||
} else {
|
|
||||||
$error = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$lastUsername = (null === $session) ?
|
|
||||||
'' : $session->get(SecurityContextInterface::LAST_USERNAME);
|
|
||||||
|
|
||||||
|
|
||||||
return $this->render('ChillMainBundle:Login:login.html.twig', array(
|
return $this->render('ChillMainBundle:Login:login.html.twig', array(
|
||||||
'last_username' => $lastUsername,
|
'last_username' => $helper->getLastUsername(),
|
||||||
'error' => (empty($error)) ? $error : $error->getMessage()
|
'error' => $helper->getLastAuthenticationError()
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function LoginCheckAction(Request $request)
|
public function LoginCheckAction(Request $request)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user