getRequest(); $session = $request->getSession(); if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) { $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR); } else { $error = $session->get(SecurityContext::AUTHENTICATION_ERROR); $session->remove(SecurityContext::AUTHENTICATION_ERROR); } return $this->render('KekRozsakSecurityBundle:Default:login.html.twig', array( 'last_username' => $session->get(SecurityContext::LAST_USERNAME), 'error' => $error, )); } }