|
|
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|
|
namespace SixShop\Auth\Hook;
|
|
|
|
|
|
use Composer\Factory;
|
|
|
+use SixShop\Auth\Config;
|
|
|
use SixShop\Core\Attribute\Hook;
|
|
|
use Symfony\Component\HttpClient\Exception\ClientException;
|
|
|
use Symfony\Component\HttpClient\HttpClient;
|
|
|
@@ -21,7 +22,7 @@ class AppStatusHook
|
|
|
|
|
|
private HttpClientInterface $httpClient;
|
|
|
public function __construct(
|
|
|
- private readonly Env $env,
|
|
|
+ private readonly Config $config,
|
|
|
)
|
|
|
{
|
|
|
$authConfigSource = Factory::createConfig()->getAuthConfigSource();
|
|
|
@@ -35,10 +36,8 @@ class AppStatusHook
|
|
|
'base_uri' => self::BASE_URL,
|
|
|
'headers' => ['Authorization' => 'Bearer ' . $bearerToken],
|
|
|
];
|
|
|
- if ($this->env->get('IS_DDEV_PROJECT') === true) {
|
|
|
- $defaultOptions['verify_peer'] = false;
|
|
|
- $defaultOptions['verify_host'] = false;
|
|
|
- }
|
|
|
+ $defaultOptions['verify_peer'] = $this->config->verify_peer;
|
|
|
+ $defaultOptions['verify_host'] = $this->config->verify_host;
|
|
|
$this->httpClient = HttpClient::create($defaultOptions);
|
|
|
|
|
|
}
|