symfony - No route found for "GET /login -
when try login wrong credentials says "try again, wrong credentials", after entering correct credentials gives error no route found "get /" (from "http://localhost/bdayproj/web/app_dev.php/login"). below configuration of security.yml
security: encoders: fos\userbundle\model\userinterface: bcrypt role_hierarchy: role_admin: role_user role_super_admin: role_admin # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers providers: in_memory: memory: ~ fos_userbundle: id: fos_user.user_provider.username firewalls: # disables authentication assets , profiler, adapt according needs dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: pattern: ^/ form_login: provider: fos_userbundle csrf_token_generator: security.csrf.token_manager logout: true anonymous: true # activate different ways authenticate # http_basic: ~ # http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate # form_login: ~ # http://symfony.com/doc/current/cookbook/security/form_login_setup.html access_control: - { path: ^/login$, role: is_authenticated_anonymously } - { path: ^/register, role: is_authenticated_anonymously } - { path: ^/resetting, role: is_authenticated_anonymously } - { path: ^/admin/, role: role_admin }
and routing.yml
app: resource: "@appbundle/controller/" type: annotation fos_user: resource: "@fosuserbundle/resources/config/routing/all.xml"
you have specify login path in security file
this example :
firewalls: main: pattern: ^/ form_login: login_path: fos_user_security_login check_path: fos_user_security_check provider: fos_userbundle csrf_provider: security.csrf.token_manager default_target_path: /
hope helps
Comments
Post a Comment