Symfony >= 5.3
app isn't API
app isn't SPA
don't use FOSUserBundle
Do I need to set json_login setting in security.yaml?
Do I need to set custom_authenticator setting in security.yaml?
I tried via form_login and custom_authenticator but I don't need a redirect
I tried via json_login(without custom_authenticator) but I am not authenticated
I solved the problem I added class App\Security\ProfileLoginAuthenticator.php
override methods onAuthenticationSuccess, onAuthenticationFailure, return in them JsonResponse
set this class in security.yaml, in section security->firewalls->custom_authenticator
JS code: