Relative Content

Tag Archive for symfonysymfony6

Symfony custom logout, error “Unable to logout with CSRF token validation”

namespace AppControllerSecurityController; use SymfonyBundleSecurityBundleSecurity; use SymfonyComponentRoutingAttributeRoute; class SecurityController { #[Route(path: ‘/logout’, name: ‘logout’)] public function someAction(Security $security): Response { $response = $security->logout(); return $this->redirectToRoute(‘login’); } } Twig <a href=”{{ path(‘logout’, {‘token’ : csrf_token(‘logout’)}) }}”> I get it from documentation Symfony 6.4 but faced with error “Unable to logout with CSRF token validation. ” what wrong […]

Symfony custom logout, error “Unable to logout with CSRF token validation”

namespace AppControllerSecurityController; use SymfonyBundleSecurityBundleSecurity; use SymfonyComponentRoutingAttributeRoute; class SecurityController { #[Route(path: ‘/logout’, name: ‘logout’)] public function someAction(Security $security): Response { $response = $security->logout(); return $this->redirectToRoute(‘login’); } } Twig <a href=”{{ path(‘logout’, {‘token’ : csrf_token(‘logout’)}) }}”> I get it from documentation Symfony 6.4 but faced with error “Unable to logout with CSRF token validation. ” what wrong […]

Symfony custom logout, error “Unable to logout with CSRF token validation”

namespace AppControllerSecurityController; use SymfonyBundleSecurityBundleSecurity; use SymfonyComponentRoutingAttributeRoute; class SecurityController { #[Route(path: ‘/logout’, name: ‘logout’)] public function someAction(Security $security): Response { $response = $security->logout(); return $this->redirectToRoute(‘login’); } } Twig <a href=”{{ path(‘logout’, {‘token’ : csrf_token(‘logout’)}) }}”> I get it from documentation Symfony 6.4 but faced with error “Unable to logout with CSRF token validation. ” what wrong […]

Symfony custom logout, error “Unable to logout with CSRF token validation”

namespace AppControllerSecurityController; use SymfonyBundleSecurityBundleSecurity; use SymfonyComponentRoutingAttributeRoute; class SecurityController { #[Route(path: ‘/logout’, name: ‘logout’)] public function someAction(Security $security): Response { $response = $security->logout(); return $this->redirectToRoute(‘login’); } } Twig <a href=”{{ path(‘logout’, {‘token’ : csrf_token(‘logout’)}) }}”> I get it from documentation Symfony 6.4 but faced with error “Unable to logout with CSRF token validation. ” what wrong […]