mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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)
|
||||
{
|
||||
|
||||
$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);
|
||||
|
||||
$helper = $this->get('security.authentication_utils');
|
||||
|
||||
return $this->render('ChillMainBundle:Login:login.html.twig', array(
|
||||
'last_username' => $lastUsername,
|
||||
'error' => (empty($error)) ? $error : $error->getMessage()
|
||||
'last_username' => $helper->getLastUsername(),
|
||||
'error' => $helper->getLastAuthenticationError()
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
public function LoginCheckAction(Request $request)
|
||||
|
Loading…
x
Reference in New Issue
Block a user