我是 symfony 4.4 的新手,我正在为 security.yaml 文件中的角色苦苦挣扎,我有 3 种类型的用户:管理员、招聘人员和用户,我试图同时让招聘人员访问登录表单security_login_recruteur我希望用户能够访问他的登录表单 security_login
这是我的security.yaml文件
security:
encoders:
App\Entity\User:
algorithm: bcrypt
App\Entity\Recruteur:
algorithm: bcrypt
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
users_in_memory: { memory: null }
in_database:
entity:
class: App\Entity\User # here i'm trying to mention both of the entities
App\Entity\Recruteur
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: lazy
provider: in_database
form_login:
login_path: security_login |security_login_recruteur #here i'm tring to put both of the paths
check_path: security_login | security_login_recruteur
logout:
path: security_logout | security_logout_recruteur #also in the logout path
target: home
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication
# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
- {path: ^/recruteur, roles: ROLE_RECRUTEUR }
#- { path: ^/admin, roles: ROLE_ADMIN }
我在尝试访问 /recruteur/connexion 后遇到了这个错误
无法为命名路由“security_login |security_login_recruteur”生成 URL,因为这样的路由不存在。
谁能帮帮我?