Ich möchte Mitglieder von der Frontend einloggen und ich habe meine Authentifizierung Handler unten definiert und fügte hinzu, es als eine Dienstleistung, die mir eine JSON-Antwort wie erwartet.Symfony3 und Ajax Authentifizierung
Ich bekomme jedoch die gleichen Ergebnisse unabhängig davon, ob ein Benutzer registriert ist oder nicht. Hier ist die Antwort
{"success":false,"message":"Bad credentials."}
Hier ist mein security.yml
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
admin:
pattern: /admin(.*)
context: user
form_login:
provider: fos_userbundle
login_path: /admin/login
use_forward: false
check_path: /admin/login_check
failure_path: null
logout:
path: /admin/logout
target: /admin/login
anonymous: true
main:
pattern: .*
context: user
form_login:
provider: fos_userbundle
login_path: /login
use_forward: false
check_path: fos_user_security_check
failure_path: null
success_handler: authentication_handler
failure_handler: authentication_handler
logout: true
anonymous: true
routing.yml
fos_user_security_check:
path: /login_check
defaults:
_controller: FOSUserBundle:Security:check
fos_user_security_logout:
path: /logout
defaults:
_controller: FOSUserBundle:Security:logout