title: symfony fosuserbundle redirection after login
body: <p>i have a login form what i want to do that if a user have role user tries to login he's redirected to page voiture_new and if an admin eventually has a role admin he's redirected to the admin page 
  PS : i'm using easyadminbundle</p>
  
  <p>here's what i've added to the loginaction of my controller</p>
  
  <pre><code>          $authChecker = $this-&gt;container-   &gt;get('security.authorization_checker');
  $router = $this-&gt;container-&gt;get('router');
  
  if ($authChecker-&gt;isGranted('ROLE_ADMIN')) {
      return new RedirectResponse($router-&gt;generate('admin'), 307);
  } 
  
  if ($authChecker-&gt;isGranted('ROLE_USER')) {
      return new RedirectResponse($router-&gt;generate('voiture_new'), 307);
  }
  </code></pre>
  
  <p>and here's my security.yml</p>
  
  <pre><code>    security:
  encoders:
      FOS\UserBundle\Model\UserInterface: bcrypt
  
  role_hierarchy:
      ROLE_ADMIN:       ROLE_USER
      ROLE_SUPER_ADMIN: ROLE_ADMIN
  
  providers:
      fos_userbundle:
          id: fos_user.user_provider.username_email
  
  firewalls:
      main:
          pattern: ^/
          form_login:
              provider: fos_userbundle
              csrf_token_generator: security.csrf.token_manager
              always_use_default_target_path: false
              default_target_path:  /voiture/new
              check_path: fos_user_security_check
  
              # if you are using Symfony &lt; 2.8, use the following config instead:
              # csrf_provider: form.csrf_provider
  
          logout:       true
          anonymous:    true
  
  access_control:
      - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
      - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
      - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
      - { path: ^/admin/, role: ROLE_ADMIN }
      - { path: ^/marque/, role: ROLE_ADMIN }
      - { path: ^/modele/, role: ROLE_ADMIN }
      - { path: ^/user/, role: ROLE_ADMIN }
      - { path: ^/voiture/, role: ROLE_USER }
      - { path: ^/profile/, role: ROLE_USER }
      - { path: ^/interventions/, role: ROLE_USER }
  </code></pre>
  
  <p>but always i'mredirected to voiture_new  even if the user have a role admin waht i'm missing ?</p>