I'm using JMSI18nRoutingBundle for routing translations, with custom configuration, that is no prefix for all routes:
# app/config/config.yml
jms_i18n_routing:
default_locale: it
locales: [it, en]
strategy: custom
www.example.com/contatti
www.example.com/contact
This is working fine, a like that bundle. Not i have to develop the admin part of the project, of course securing it. I'm stuck at security configuration (an excerpt):
# app/config/config.yml
security:
firewalls:
secured_area:
pattern: ^/
anonymous: ~
form_login:
login_path: /login
check_path: /login_check
login_path
is statically defined using security.yml
. So, how i'm supposed to specify the correct login (localized) path? Assuming form is accessibile using:
www.example.com/accesso
www.example.com/login
As Wojciech Jasiński mentioned already in the comments, you should use route name instead of pattern.
Just to bring some light...
You should define your route
gremo_login_path:
pattern: /login
...and use it in security.yml
security:
firewalls:
secured_area:
pattern: ^/
anonymous: ~
form_login:
login_path: gremo_login_path
check_path: /login_check
See also related issues:
https://github.com/schmittjoh/JMSI18nRoutingBundle/issues/7
https://github.com/symfony/symfony/pull/3791/files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With