diff --git a/src/Sqs/Connector.php b/src/Sqs/Connector.php index 70222cb..0abdf7f 100644 --- a/src/Sqs/Connector.php +++ b/src/Sqs/Connector.php @@ -19,16 +19,18 @@ public function connect(array $config) { $config = $this->getDefaultConfiguration($config); - if (isset($config['key']) && isset($config['secret'])) { - $config['credentials'] = Arr::only($config, ['key', 'secret']); + if (! empty($config['key']) && ! empty($config['secret'])) { + $config['credentials'] = Arr::only($config, ['key', 'secret', 'token']); } $queue = new Queue( - new SqsClient($config), + new SqsClient( + Arr::except($config, ['token']) + ), $config['queue'], Arr::get($config, 'prefix', '') ); return $queue; } -} \ No newline at end of file +}