This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

symfony simple login page error

Discussion relating to version 1.3.x and 1.4.x

symfony simple login page error

by madara84 » Sat Mar 29, 2014 9:24 pm

I tried to implement simple login page by this tutorial (i'm using symfony 2.4):
http://symfony.com/doc/current/book/security.html
Login page is fine. But when im submitting form i've got this error:

Unable to find the controller for path "/login_check". Maybe you forgot to add the matching route in your routing configuration?

I search web and tried everything. What's wrong with my configuration ?

security.yml
Code: Select all
security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER

    providers:
        in_memory:
            memory:
                users:
                    user:  { password: admin, roles: [ 'ROLE_USER' ] }
                    admin: { password: admin, roles: [ 'ROLE_ADMIN' ] }

    firewalls:
        main:
            pattern:    ^/
            form_login:
                login_path:  /login
                check_path:  /login_check
                default_target_path:  /dashboard/
        login_firewall:
            pattern:    ^/login$
            anonymous:  ~
        secured_area:
            pattern:    ^/
            form_login: ~

    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: ROLE_ADMIN }




routing.yml
Code: Select all
login:
    path:     /login
    defaults: { _controller: AdminSecurityBundle:Security:login }

login_check:
    pattern:  /login_check


PROBLEM SOLVED. HUGE MISTAKE (I DDIN'T INCLUDE SECURITY.YML IN MY CONFIG.YML :( , NOW USING FOSUSERBUNDLE)
madara84
Junior Member
 
Posts: 6
Joined: Wed Dec 12, 2012 9:14 pm