php - check_path not found with multiple firewalls in Symfony 2 -
i'm trying setup backend , frontend firewall system in symfony 2. have 2 login forms, 1 frontend , 1 admin control panel. different providers , on. configuration looks this:
security: firewalls: backend: pattern: ^/admin anonymous: true provider: admin_users form_login: login_path: /admin/login check_path: /admin/login_check default_target_path: /admin secured_area: pattern: ^/ provider: normal_users anonymous: true form_login: ~ access_control: - { path: ^/admin/login, roles: is_authenticated_anonymously } - { path: ^/admin, roles: role_admin } - { path: ^/login, roles: is_authenticated_anonymously }
and routing.yml:
login: path: /login defaults: { _controller: myfrontendbundle:default:login } login_check: path: /login_check admin_login: path: /admin/login defaults: { _controller: mybackendbundle:default:login } admin_login_check: path: /admin/login_check
seems right, i'm having following error: unable find controller path "/admin/login_check". maybe forgot add matching route in routing configuration
any ideas? :)
this solution use in projects. hope work 2 login forms too.
add stub controller
admin_login_check: path: /admin/login_check defaults: { _controller: acmedemobundle:default:adminlogincheck }
action stub. action never reached, "controller not found" error gone.
// src/acme/demobundle/controller/defaultcontroller.php public function adminlogincheckaction() { return $this->redirect($this->generateurl('admin_login')); }
Comments
Post a Comment