title: fosuserbundle override login action
body: <p>I am using FSOUserBundle and I want to override loginAction, I used this method:</p>
  
  <pre><code>namespace PjDZ\UserBundle\Controller;
  use FOS\UserBundle\Controller\SecurityController as BaseController;
  
  class SecurityController extends BaseController {
  
  public function loginAction(\Symfony\Component\HttpFoundation\Request $request)
  {
      /** @var $session \Symfony\Component\HttpFoundation\Session\Session */
      $session = $request-&gt;getSession();
  
      // get the error if any (works with forward and redirect -- see below)
      if ($request-&gt;attributes-&gt;has(SecurityContext::AUTHENTICATION_ERROR)) {
          $error = $request-&gt;attributes-&gt;get(SecurityContext::AUTHENTICATION_ERROR);
      } elseif (null !== $session &amp;&amp; $session-&gt;has(SecurityContext::AUTHENTICATION_ERROR))    {
          $error = $session-&gt;get(SecurityContext::AUTHENTICATION_ERROR);
          $session-&gt;remove(SecurityContext::AUTHENTICATION_ERROR);
      } else {
          $error = '';
      }
  
      if ($error) {
          // TODO: this is a potential security risk (see http://trac.symfony-project.org/ticket/9523)
          $error = $error-&gt;getMessage();
      }
      // last username entered by the user
      $lastUsername = (null === $session) ? '' : $session-&gt;get(SecurityContext::LAST_USERNAME);
  
      $csrfToken = $this-&gt;container-&gt;has('form.csrf_provider')
          ? $this-&gt;container-&gt;get('form.csrf_provider')-&gt;generateCsrfToken('authenticate')
          : null;
  
  
      return $this-&gt;renderLogin(array(
          'last_username' =&gt; $lastUsername,
          'error'         =&gt; $error,
          'csrf_token' =&gt; $csrfToken,
      ));
  }
  }
  </code></pre>
  
  <p>but when I try to show /login page I get a blank page, any idea ?!!.
  forgive my bad english.</p>