duanbinian2243 2016-04-02 19:25
浏览 38

Symfony3找不到“GET / logout”的路线

I cant seam to get the logout working on symfony3. I've been following the symfony documentation SecurityBundle Configuration and as far as I can tell my config file seams to be by there specification yet when i go to /logout i get the following response:

No route found for "GET /logout" (from "http://localhost:8000/admin").

Any ideas on what my problem could be?

My security.yml:

security:
encoders:
    AppBundle\Entity\User:
        algorithm: bcrypt
    Symfony\Component\Security\Core\User\User: plaintext
providers:
    chain_provider:
            chain:
                providers: [in_memory, database_provider]
    in_memory:
        memory:
          users:
            test:
                password: test
                roles: 'ROLE_ADMIN'
            admin:
                password: admin
                roles: 'ROLE_ADMIN'
    database_provider:
        entity:
            class: AppBundle:User
            property: email
firewalls:
    dev:
        pattern: ^/(_(profiler|wdt)|css|images|js)/
        security: false
    main:
        anonymous: true
        logout: true
        form_login:
            check_path: /login
            login_path: /login
            default_target_path: /login
            always_use_default_target_path: true
        logout:
            path:   /logout
            target: /login
  • 写回答

1条回答 默认 最新

  • douxu0550 2016-04-02 19:30
    关注

    The awsver is so simple I almost removed the question, but I guess having a well configured security.yml can be a good example for other who are having problems.

    just add the route to route.yml

    # app/config/routing.yml
    logout:
       path: /logout
    
    评论

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统