Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im new to symfony2 version 3.0 and Im trying to create a login form. But I'm stuck in security.yml configuration and I dont know whats going on. Im been searching in google for 3 hours but no luck. Hope you can help me. So far here is my code.


Every time I go to http://localhost:8000/admin it gives me this error

The check_path "user/login-check" for login method "form_login" is not matched by the firewall pattern "^/admin".


Invalid configuration for path "security.firewalls.secured_area": The check_path "user/login-check" for login method "form_login" is not matched by the firewall pattern "^/admin".


What I have tried:

security:
encoders:
AppBundle\Entity\User:
algorithm: bcrypt

providers:
db_provider:
entity:
class: AppBundle:User
property: username

firewalls:
login_area:
pattern: ^/user/login$
security: false

secured_area:
pattern: ^/admin
anonymous: ~
form_login:
login_path: user/login
check_path: user/login-check
always_use_default_target_path: true
default_target_path: /admin
provider: db_provider
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900