Skip to content
Snippets Groups Projects

Fix request stack

1 file
+ 4
3
Compare changes
  • Side-by-side
  • Inline
+ 4
3
@@ -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();
}
Loading