Is it possible to perform an automatic redirect to the some route (i.e. /) for the specific route /login only for users that are AUTHENTICATED? and
I'm using the routing and security to enable this.
#routing.yml
index:
path: /
defaults: { _controller: AppBundle:Base:index }
methods: [GET]
login:
path: /login
defaults: { _controller: AppBundle:Security:login }
methods: [GET]
If a user is logged in, he get redirected to the dashboard. If not, he will see the login route.
#security.yml
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/dashboard, role: ROLE_USER }
Hope this helps you. :)