To use the application which I implement the user must login first. The login form appears on the "/" url.
So I create the following "security.yml".
security:
access_decision_manager:
strategy: unanimous
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
secured_area:
pattern: ^/
anonymous: ~
form_login:
login_path: login
check_path: login_check
csrf_provider: form.csrf_provider
success_handler: app_user_handler_login
failure_handler: app_user_handler_login
logout:
path: /logout
target: /
switch_user: {role: ROLE_ADMIN}
providers:
administrators:
entity: { class: AppUserBundle:User, property: username }
encoders:
App\UserBundle\Entity\User:
algorithm: bcrypt
role_hierarchy:
ROLE_USER: ~
ROLE_TEACHER: [ROLE_USER]
ROLE_EDITOR: [ROLE_TEACHER]
ROLE_ADMIN: [ROLE_EDITOR]
My routing file have the following content.
login:
path: /
defaults: { _controller: AppSecurityBundle:Default:index}
login_check:
path: /login_check
logout:
path: /logout
Now if i call the url "/app_dev.php/" the login form appears and if i enter a valid username with password i receive the following error.
"No route found for "POST //login_check"
But if i call the url "/" or "/app_dev.php" everything is ok, how can i solve this problem?