title: How to restrict acces to login form if user is authenticated?
body: <p>I used the basic login form in symfony2 and it works well ( without FOSUSERBUNDLE ).
  But how to restrict acces if a user is already authenticated ?</p>
  
  <pre><code>if ($this-&gt;get('security.context')-&gt;isGranted('ROLE_ADMIN')) { }
  </code></pre>
  
  <p>the code above does not work because the login route is not under the firewall... and throw :</p>
  
  <blockquote>
    <p>The security context contains no authentication token. One possible reason may be that there is no firewall configured for this URL.</p>
  </blockquote>
  
  <p>How to solve it ?</p>