In the Book for symfony2 on pages 156-157 There is a nice tutorial for how to make your own login system using forms.
When I follow these steps, I am faced with a “No route found for “POST /login_check”” error message.
security.yml:
secured_area:
pattern: ^/secured/
form_login:
login_path: /login
check_path: /secured/login_check
logout:
path: /secured/logout
target: /login
routing.yml:
login:
pattern: /login
defaults: { _controller: MySecurityBundle:Security:login }
login_check:
pattern: /secured/login_check
Can anyonw tell me why mine doesn’t work and sensioLabs apparently does?
The only difference I can see is that I wiped out the Acme bundle and created a fresh bundle with security, copy-pasting all files as per tutorial (I thought ACME was a demo bundle and not necessary for functions such as security?).
I have no default route set for the login_check route, since tutorial says on page 156 “You will not need to implement a controller for the /login_check URL as the firewall will
automatically catch and process any form submitted to this URL.”
You don’t need to specify controller but you have to specify routing path, in your case it is
but you are submitting form to
/login_check, edit either yor form action to include/secureor remove it from routing.yml