https://dev.m-medientechnik.de/accessory-assistant/matching-accessory-rule-ids/3b4693c6d0ea404e9d5dd6490d582885 Return to referer URL

Exceptions

The provided CSRF token is not valid

Exception

Shopware\Storefront\Framework\Csrf\Exception\ InvalidCsrfTokenException

  1. } else {
  2. $session->getFlashBag()->add('danger', $this->translator->trans('error.message-403'));
  3. }
  4. }
  5. throw new InvalidCsrfTokenException();
  6. }
  7. }
  8. public function reset(): void
  9. {
  1. // Only check csrf token on storefront routes
  2. if (!\in_array(StorefrontRouteScope::ID, $scopes, true)) {
  3. return;
  4. }
  5. $this->validateCsrfToken($request);
  6. }
  7. /**
  8. * @deprecated tag:v6.5.0 - reason:visibility-change - method will become private in v6.5.0
  9. */
  1. $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
  2. $e = $this->stopwatch->start($this->name, 'event_listener');
  3. try {
  4. ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
  5. } finally {
  6. if ($e->isStarted()) {
  7. $e->stop();
  8. }
  9. }
  1. foreach ($listeners as $listener) {
  2. if ($stoppable && $event->isPropagationStopped()) {
  3. break;
  4. }
  5. $listener($event, $eventName, $this);
  6. }
  7. }
  8. /**
  9. * Sorts the internal list of listeners for the given event by priority.
  1. } else {
  2. $listeners = $this->getListeners($eventName);
  3. }
  4. if ($listeners) {
  5. $this->callListeners($listeners, $eventName, $event);
  6. }
  7. return $event;
  8. }
  1. *
  2. * @return TEvent
  3. */
  4. public function dispatch($event, ?string $eventName = null): object
  5. {
  6. $event = $this->dispatcher->dispatch($event, $eventName);
  7. if (!$event instanceof FlowEventAware) {
  8. return $event;
  9. }
  1. *
  2. * @return TEvent
  3. */
  4. public function dispatch($event, ?string $eventName = null): object
  5. {
  6. $event = $this->dispatcher->dispatch($event, $eventName);
  7. if (EnvironmentHelper::getVariable('DISABLE_EXTENSIONS', false)) {
  8. return $event;
  9. }
  1. $this->definitionRegistry = $definitionRegistry;
  2. }
  3. public function dispatch($event, ?string $eventName = null): object
  4. {
  5. $event = $this->dispatcher->dispatch($event, $eventName);
  6. if (Feature::isActive('FEATURE_NEXT_17858')) {
  7. return $event;
  8. }
  1. }
  2. $this->dispatch($nested, $name);
  3. }
  4. }
  5. return $this->dispatcher->dispatch($event, $eventName);
  6. }
  7. /**
  8. * @param callable $listener can not use native type declaration @see https://github.com/symfony/symfony/issues/42283
  9. */
  1. try {
  2. $this->beforeDispatch($eventName, $event);
  3. try {
  4. $e = $this->stopwatch->start($eventName, 'section');
  5. try {
  6. $this->dispatcher->dispatch($event, $eventName);
  7. } finally {
  8. if ($e->isStarted()) {
  9. $e->stop();
  10. }
  11. }
  1. if (false === $controller = $this->resolver->getController($request)) {
  2. throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.', $request->getPathInfo()));
  3. }
  4. $event = new ControllerEvent($this, $controller, $request, $type);
  5. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER);
  6. $controller = $event->getController();
  7. // controller arguments
  8. $arguments = $this->argumentResolver->getArguments($request, $controller);
  1. {
  2. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3. $this->requestStack->push($request);
  4. try {
  5. return $this->handleRaw($request, $type);
  6. } catch (\Exception $e) {
  7. if ($e instanceof RequestExceptionInterface) {
  8. $e = new BadRequestHttpException($e->getMessage(), $e);
  9. }
  10. if (false === $catch) {
  1. $this->boot();
  2. ++$this->requestStackSize;
  3. $this->resetServices = true;
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
  2. Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3. }
  4. try {
  5. return $kernel->handle($request, $type, $catch);
  6. } finally {
  7. // restore global state
  8. Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
  9. }
  10. }
  1. if ($this->surrogate) {
  2. $this->surrogate->addSurrogateCapability($request);
  3. }
  4. // always a "master" request (as the real master request can be in cache)
  5. $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
  6. /*
  7. * Support stale-if-error given on Responses or as a config option.
  8. * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
  9. * Cache-Control directives) that
  1. */
  2. protected function pass(Request $request, bool $catch = false)
  3. {
  4. $this->record($request, 'pass');
  5. return $this->forward($request, $catch);
  6. }
  7. /**
  8. * Invalidates non-safe methods (like POST, PUT, and DELETE).
  9. *
  1. *
  2. * @see RFC2616 13.10
  3. */
  4. protected function invalidate(Request $request, bool $catch = false)
  5. {
  6. $response = $this->pass($request, $catch);
  7. // invalidate only when the response is successful
  8. if ($response->isSuccessful() || $response->isRedirect()) {
  9. try {
  10. $this->store->invalidate($request);
  1. }
  2. $this->traces[$this->getTraceKey($request)] = [];
  3. if (!$request->isMethodSafe()) {
  4. $response = $this->invalidate($request, $catch);
  5. } elseif ($request->headers->has('expect') || !$request->isMethodCacheable()) {
  6. $response = $this->pass($request, $catch);
  7. } elseif ($this->options['allow_reload'] && $request->isNoCache()) {
  8. /*
  9. If allow_reload is configured and the client requests "Cache-Control: no-cache",
  1. && $container->getParameter('shopware.http.cache.enabled');
  2. if ($enabled && $container->has(CacheStore::class)) {
  3. $kernel = new static::$httpCacheClass($kernel, $container->get(CacheStore::class), null, ['debug' => $this->debug]);
  4. }
  5. $response = $kernel->handle($transformed, $type, $catch);
  6. // fire event to trigger runtime events like seo url headers
  7. $event = new BeforeSendResponseEvent($transformed, $response);
  8. $container->get('event_dispatcher')->dispatch($event);
in vendor/shopware/core/HttpKernel.php -> doHandle (line 81)
  1. if (!\is_bool($catch)) {
  2. Feature::triggerDeprecationOrThrow('v6.5.0.0', 'The third parameter `$catch` of `HttpKernel->handle()` will be typed to `bool`');
  3. }
  4. try {
  5. return $this->doHandle($request, (int) $type, (bool) $catch);
  6. } catch (Exception $e) {
  7. /** @var Params|array{url?: string} $connectionParams */
  8. $connectionParams = self::getConnection()->getParams();
  9. $message = str_replace([$connectionParams['url'] ?? null, $connectionParams['password'] ?? null, $connectionParams['user'] ?? null], '******', $e->getMessage());
HttpKernel->handle() in public/index.php (line 85)
  1. }
  2. } else {
  3. $kernel = new InstallerKernel($appEnv, $debug);
  4. }
  5. $result = $kernel->handle($request);
  6. if ($result instanceof Response) {
  7. $result->send();
  8. $kernel->terminate($request, $result);
  9. } else {

Logs

Level Channel Message
INFO 15:29:46 php Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated
{
    "exception": {}
}
INFO 15:29:46 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "bae53a"
    },
    "request_uri": "https://dev.m-medientechnik.de/_profiler/bae53a",
    "method": "GET"
}
INFO 15:29:46 php User Deprecated: Since shopware/core : Class "Shopware\Storefront\Framework\Csrf\CsrfRouteListener" is deprecated and will be removed in v6.5.0.0.
{
    "exception": {}
}
INFO 15:29:46 php User Deprecated: Since shopware/core : Class "Shopware\Storefront\Framework\Csrf\CsrfRouteListener" is deprecated and will be removed in v6.5.0.0.
{
    "exception": {}
}
INFO 15:29:46 php User Deprecated: Since shopware/core : Class "Shopware\Core\Content\Mail\Service\MailerTransportFactory" is deprecated and will be removed in v6.5.0.0.
{
    "exception": {}
}
INFO 15:29:46 php User Deprecated: Since shopware/core : Class "Shopware\Core\Content\Mail\Service\MailerTransportFactory" is deprecated and will be removed in v6.5.0.0.
{
    "exception": {}
}
INFO 15:29:46 php User Deprecated: Since shopware/core : Class "Shopware\Storefront\Framework\Csrf\CsrfRouteListener" is deprecated and will be removed in v6.5.0.0.
{
    "exception": {}
}
INFO 15:29:46 php User Deprecated: Since shopware/core : Class "Shopware\Storefront\Framework\Csrf\CsrfRouteListener" is deprecated and will be removed in v6.5.0.0.
{
    "exception": {}
}

Stack Trace

InvalidCsrfTokenException
Shopware\Storefront\Framework\Csrf\Exception\InvalidCsrfTokenException:
The provided CSRF token is not valid

  at vendor/shopware/storefront/Framework/Csrf/CsrfRouteListener.php:154
  at Shopware\Storefront\Framework\Csrf\CsrfRouteListener->validateCsrfToken()
     (vendor/shopware/storefront/Framework/Csrf/CsrfRouteListener.php:116)
  at Shopware\Storefront\Framework\Csrf\CsrfRouteListener->csrfCheck()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/shopware/core/Content/Flow/Dispatching/FlowDispatcher.php:56)
  at Shopware\Core\Content\Flow\Dispatching\FlowDispatcher->dispatch()
     (vendor/shopware/core/Framework/Webhook/WebhookDispatcher.php:98)
  at Shopware\Core\Framework\Webhook\WebhookDispatcher->dispatch()
     (vendor/shopware/core/Framework/Event/BusinessEventDispatcher.php:55)
  at Shopware\Core\Framework\Event\BusinessEventDispatcher->dispatch()
     (vendor/shopware/core/Framework/Event/NestedEventDispatcher.php:37)
  at Shopware\Core\Framework\Event\NestedEventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:482)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:272)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->pass()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:288)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:216)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
     (vendor/shopware/core/HttpKernel.php:156)
  at Shopware\Core\HttpKernel->doHandle()
     (vendor/shopware/core/HttpKernel.php:81)
  at Shopware\Core\HttpKernel->handle()
     (public/index.php:85)