From 3a66a45331e0b5d80ff200259ef82a991fe7c333 Mon Sep 17 00:00:00 2001 From: nicxvan <29861-nicxvan@users.noreply.drupalcode.org> Date: Thu, 30 Jan 2025 18:08:41 +0000 Subject: [PATCH] Fix request stack --- src/ShipStation.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ShipStation.php b/src/ShipStation.php index 75592a3..5f631d5 100644 --- a/src/ShipStation.php +++ b/src/ShipStation.php @@ -129,7 +129,7 @@ class ShipStation { $this->systemDateConfig = $config_factory->get('system.date'); $this->entityTypeManager = $entity_type_manager; $this->eventDispatcher = $event_dispatcher; - $this->request = $request_stack->getCurrentRequest(); + $this->request = $request_stack; $this->messenger = $messenger; $this->logger = $logger; $this->moduleHandler = $module_handler; @@ -146,13 +146,14 @@ class ShipStation { $auth_key = $this->shipStationConfig->get('commerce_shipstation_alternate_auth'); $username = $this->shipStationConfig->get('commerce_shipstation_username'); $password = $this->shipStationConfig->get('commerce_shipstation_password'); + $current_request = $this->request->getCurrentRequest(); - if ($this->request->query->get('SS-UserName') === $username && $this->request->query->get('SS-Password') === $password) { + if ($current_request->query->get('SS-UserName') === $username && $current_request->query->get('SS-Password') === $password) { return AccessResult::allowed(); } // Allow ShipStation to authenticate using an auth token. - $request_auth_key = $this->request->query->get('auth_key'); + $request_auth_key = $current_request->query->get('auth_key'); if ($auth_key && $request_auth_key && $auth_key === $request_auth_key) { return AccessResult::allowed(); } -- GitLab