Allow to start without password

This commit is contained in:
Alexander Pankratov 2024-04-24 02:01:56 +02:00
parent 6e37877ca2
commit c324de5d21
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class SystemApiExtensions
foreach ($sessions as $sessionKey => $session) { foreach ($sessions as $sessionKey => $session) {
$instance = $this->client->instances[$sessionKey]; $instance = $this->client->instances[$sessionKey];
if ($instance->getAuthorization() === API::LOGGED_IN) { if ($instance->getAuthorization() === API::LOGGED_IN) {
$results[$sessionKey] = $instance->fullGetSelf(); $results[$sessionKey] = $instance->getSelf();
} }
} }
return $results; return $results;

View File

@ -24,7 +24,7 @@ class Authorization implements Middleware
$this->ipWhitelist = (array)Config::getInstance()->get('api.ip_whitelist', []); $this->ipWhitelist = (array)Config::getInstance()->get('api.ip_whitelist', []);
$this->passwords = Config::getInstance()->get('api.passwords', []); $this->passwords = Config::getInstance()->get('api.passwords', []);
if (!$this->ipWhitelist && !$this->passwords) { if (!$this->ipWhitelist && !$this->passwords) {
throw new \InvalidArgumentException('API is unprotected! Please specify IP_WHITELIST or PASSWORD in .env.docker'); error('API is unprotected! Please specify IP_WHITELIST or PASSWORD in .env.docker');
} }
} }