我有下一个security.yml:
security:
encoders:
Test\BackEndBundle\Entity\User:
algorithm: sha512
encode-as-base64: true
iterations: 10
providers:
main:
entity: { class: TestBackEndBundle:User, property: username }
firewalls:
main:
pattern: /.*
form_login:
check_path: _security_check
login_path: _security_login
default_target_path: homepage
logout: true
security: true
anonymous: true
access_control:
- { path: ^/service, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /.*, roles: {ROLE_PARTNER, ROLE_ADMIN} }
以及下一个路由:
homepage:
pattern: /
defaults: { _controller: TestBackEndBundle:Default:index }
_security_login:
pattern: /login
defaults: { _controller: TestBackEndBundle:Security:login }
_security_check:
pattern: /login_check
_security_logout:
pattern: /logout
身份验证效果很好,而不是登录后重定向。应用程序重定向到/_wdt/5044c6f2a329c。如何重定向到主页?谢谢。