How set login path with user locale? I tried
check_path: /{_locale}/login_check
and
check_path: /(en|ru)/login_check
but nothing ((
Route config
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
prefix: /{_locale}
Exception:
You must configure the check path to be handled by the firewall using form_login in your security firewall configuration.
Use routes instead of paths in the firewall configuration:
security:
firewalls:
main:
form_login:
provider: fos_userbundle
login_path: fos_user_security_login
check_path: fos_user_security_check
csrf_provider: form.csrf_provider
link to topic in symfony forum
Hm, i didn't recognized your prefix: /{_locale}
under
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
You should write route to your action in (for exmpl ofc) routing.yml
:
login_check:
pattern: /{_locale}/login_check
defaults: { _controller: YourBundle:Controller:someaction, _locale: en }
requirements:
_locale: en|ru
and in security.xml
:
check_path: /{_locale}/login_check
Don't forget to add
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
in your app/config/routing.yml
file.
try it, gl.
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