Load site settings from dotenv and store OAuth credentials
This commit is contained in:
@@ -19,12 +19,8 @@ final class IdentityProvider
|
||||
private readonly Client $http;
|
||||
private array $oidc = [];
|
||||
|
||||
public function __construct(private readonly array $config)
|
||||
public function __construct(private readonly array $config, string $secret)
|
||||
{
|
||||
$secret = getenv($config['secret_env']);
|
||||
if (!is_string($secret) || $secret === '') {
|
||||
throw new RuntimeException('身份服务的客户端密钥尚未配置。');
|
||||
}
|
||||
$this->http = new Client(['timeout' => 8, 'connect_timeout' => 4, 'allow_redirects' => false]);
|
||||
$scope = preg_split('/\s+/', trim($config['scope']), -1, PREG_SPLIT_NO_EMPTY);
|
||||
$authorization = $config['authorization'];
|
||||
|
||||
Reference in New Issue
Block a user