mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 00:47:25 -06:00
Ensured empty initial PAI keys are discarded
This commit is contained in:
parent
c7f0d14c1b
commit
3f01fad12f
@ -15,7 +15,7 @@ class InitialApiKeyDelegator
|
||||
public function __invoke(ContainerInterface $container, string $serviceName, callable $callback): Application
|
||||
{
|
||||
$initialApiKey = $container->get('config')['initial_api_key'] ?? null;
|
||||
if ($initialApiKey !== null) {
|
||||
if (! empty($initialApiKey)) {
|
||||
$this->createInitialApiKey($initialApiKey, $container);
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,9 @@ class InitialApiKeyDelegatorTest extends TestCase
|
||||
|
||||
public function provideConfigs(): iterable
|
||||
{
|
||||
yield [[], 0];
|
||||
yield [['initial_api_key' => null], 0];
|
||||
yield [['initial_api_key' => 'the_initial_key'], 1];
|
||||
yield 'no api key' => [[], 0];
|
||||
yield 'null api key' => [['initial_api_key' => null], 0];
|
||||
yield 'empty api key' => [['initial_api_key' => ''], 0];
|
||||
yield 'valid api key' => [['initial_api_key' => 'the_initial_key'], 1];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user