I know this is a common problem. And several questions on this topic have been published. I tried all of these solutions recommended in these issues, but no one worked.
I found that this problem occurs if I put it form_loginbehind firewall. But I do not have an additional layer in the firewall, so the path should be simple, as described in the documentation.
My security.yml
security:
encoders:
Joy\JoyBundle\Entity\User:
algorithm: sha512
encode_as_base64: true
iterations: 1
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
administrators:
entity: { class: JoyBundle:User, property: username }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/login
security: false
secured_area:
pattern: ^/
anonymous: ~
form_login:
login_path: login
check_path: login_check
logout:
path: /logout
target: /login
access_control:
- { path: ^/signup, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/, roles: ROLE_ADMIN }
My routing.yml inapp/config
login:
path: /login
defaults: { _controller: JoyBundle:Security:login }
login_check:
path: /login_check
joy_hello:
resource: "@JoyBundle/Resources/config/routing.yml"
prefix: /
So, I do a login check while accessing app_dev.php/But it shows this error after clicking the submit button in the login form.
/login _check. , ? 404 - NotFoundHttpException
login_path: /login
check_path: /login_check
. ? , .....