Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 9 |
| SecurityController | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 9 |
| loginAction | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 9 |
|||
| <?php | |
| namespace AppBundle\Controller; | |
| use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| use Symfony\Component\HttpFoundation\Request; | |
| class SecurityController extends Controller | |
| { | |
| /** | |
| * @Route("/login", name="login") | |
| * @param Request $request | |
| * @return \Symfony\Component\HttpFoundation\Response | |
| */ | |
| 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' => $lastUsername, | |
| 'error' => $error, | |
| )); | |
| } | |
| } |