3 namespace Wallabag\CoreBundle\Controller
;
5 use Symfony\Bundle\FrameworkBundle\Controller\Controller
;
6 use Symfony\Component\HttpFoundation\Request
;
7 use Symfony\Component\Security\Core\SecurityContext
;
9 class SecurityController
extends Controller
11 public function loginAction(Request
$request)
13 $session = $request->getSession();
14 // get the login error if there is one
15 if ($request->attributes
->has(SecurityContext
::AUTHENTICATION_ERROR
)) {
16 $error = $request->attributes
->get(SecurityContext
::AUTHENTICATION_ERROR
);
18 $error = $session->get(SecurityContext
::AUTHENTICATION_ERROR
);
19 $session->remove(SecurityContext
::AUTHENTICATION_ERROR
);
22 return $this->render('WallabagCoreBundle:Security:login.html.twig', array(
23 // last username entered by the user
24 'last_username' => $session->get(SecurityContext
::LAST_USERNAME
),