2 回答
TA贡献1811条经验 获得超6个赞
encoders:
App\Entity\User:
algorithm: argon2i
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
# used to reload user from session & other features (e.g. switch_user)
app_user_provider:
entity:
class: App\Entity\User
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: true
guard:
authenticators:
- App\Security\LoginFormAuthenticator
logout:
path: /logout
#ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
# 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: ^/admin, roles: ROLE_ADMIN }
- { path: ^/profile, roles: ROLE_USER }
您已经声明了一个提供者,app_user_provider:但它并未在您的防火墙内的任何地方使用。因此,在 中main:,尝试添加:
provider: app_user_provider
如果您遇到另一个问题,请尝试启用 form_login:
form_login:
check_path: LOGIN_PATH
login_path: LOGIN_PATH
- 2 回答
- 0 关注
- 164 浏览
添加回答
举报