Skip to content

Instantly share code, notes, and snippets.

@wecc
Created March 31, 2015 08:22
Show Gist options
  • Select an option

  • Save wecc/3b92112f326e506082ac to your computer and use it in GitHub Desktop.

Select an option

Save wecc/3b92112f326e506082ac to your computer and use it in GitHub Desktop.
<?php /**
* @Route("/login/", name="login_route")
*/
public function loginAction(Request $request)
{
$authenticationUtils = $this->get('security.authentication_utils');
// 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',
array(
// last username entered by the user
'last_username' => $lastUsername,
'error' => $error,
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment