gpt4 book ai didi

symfony - 无法找到路径 "/api/login_check"的 Controller 。路由配置错误

转载 作者:行者123 更新时间:2023-12-02 17:18:44 24 4
gpt4 key购买 nike

我的“login_check”有问题,我使用 Symfony 3 和 LexikJWTAuthenticationBundle。

问题:

The route is wrongly configured.

security.yml:

firewalls:

login:
pattern: ^/api/login
stateless: true
anonymous: true
form_login:
username_parameter: username
password_parameter: password
check_path: /api/login_check
success_handler: lexik_jwt_authentication.handler.authentication_success
failure_handler: lexik_jwt_authentication.handler.authentication_failure
require_previous_session: false
api:
pattern: ^/api
stateless: true
guard:
authenticators:
- lexik_jwt_authentication.jwt_token_authenticator

main:
anonymous: true

access_control:
- {path: ^/api/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- {path: ^/api, roles: IS_AUTHENTICATED_FULLY }

路由.yml:

app:
resource: '@AppBundle/Controller/'
type: rest
prefix: /api

登录检查: 路径:api/login_check

你能帮我一下吗?

美好的一天:)

最佳答案

更改您的路由文件:

app:
resource: '@AppBundle/Controller/'
type: rest
prefix: /api

api_login_check:
path: /api/login_check

关于symfony - 无法找到路径 "/api/login_check"的 Controller 。路由配置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46262232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com