I would like to implement the logout action on my Symfony
project.
At the moment, when I make the logout action, I receive the exception
controller can be blank: it will never be executed!.
I've digged into internet and Symfony docs, normally this endpoint controller is never reached.
In my context,i can't logout and i don't know why this logout function is executed.
this is my configuration SecurityController.php
/**
* @Route("/logout", name="app_logout", methods={"GET"})
*/
public function logout()
{
// controller can be blank: it will never be executed!
throw new \Exception('controller can be blank: it will never be executed!');
}
security.yaml
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
pattern: /login
provider: app_user_provider
guard:
authenticators:
- App\Security\LoginFormAuthenticator
logout:
path: app_logout
# where to redirect after logout
target: app_login
Have a nice day!