简体   繁体   English

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

[英]Symfony3 No route found for “GET /logout”

I cant seam to get the logout working on symfony3. 我无法通过缝合来解决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: 我一直在关注symfony文档SecurityBundle配置 ,据我所知,我可以告诉我的配置文件接缝是什么规格但是当我去/logout我得到以下响应:

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

Any ideas on what my problem could be? 关于我的问题可能是什么的任何想法?

My security.yml: 我的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

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. awsver非常简单,我几乎删除了这个问题,但我想有一个配置良好的security.yml可以成为其他有问题的好例子。

just add the route to route.yml 只需将路由添加到route.yml即可

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM