I use Symfony FOSUserBundle, SonataUserBundle, FOSFacebookBundle. I added a login button to my application.
I can log in using facebook, but after logging in, the page is redirected to demo / secure / login_check and I get the following error.
"The controller should return a response (zero). Have you forgotten to add a return statement somewhere in your controller?"
I already watched
The service does not start: the controller should return a response (null)
https://github.com/FriendsOfSymfony/FOSFacebookBundle/issues/186
But I don’t know what changes I should make to my configuration.
Below if my security configuration
security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN] ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] SONATA: - ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT
I tried changing the configurations as shown below to avoid a firewall matching a single URL pattern.
security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN] ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] SONATA: - ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT
But now I get another error, as below.
"InvalidConfigurationException: You are not allowed to define new elements for the" security.firewalls "path. Please define all elements for this path in the same configuration file."
source share