From c324de5d21655f4a43133bf83477667920c4011a Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Wed, 24 Apr 2024 02:01:56 +0200 Subject: [PATCH] Allow to start without password --- src/MadelineProtoExtensions/SystemApiExtensions.php | 2 +- src/Server/Authorization.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MadelineProtoExtensions/SystemApiExtensions.php b/src/MadelineProtoExtensions/SystemApiExtensions.php index 110229c..a78a223 100644 --- a/src/MadelineProtoExtensions/SystemApiExtensions.php +++ b/src/MadelineProtoExtensions/SystemApiExtensions.php @@ -32,7 +32,7 @@ class SystemApiExtensions foreach ($sessions as $sessionKey => $session) { $instance = $this->client->instances[$sessionKey]; if ($instance->getAuthorization() === API::LOGGED_IN) { - $results[$sessionKey] = $instance->fullGetSelf(); + $results[$sessionKey] = $instance->getSelf(); } } return $results; diff --git a/src/Server/Authorization.php b/src/Server/Authorization.php index 08f0729..b4db07e 100644 --- a/src/Server/Authorization.php +++ b/src/Server/Authorization.php @@ -24,7 +24,7 @@ class Authorization implements Middleware $this->ipWhitelist = (array)Config::getInstance()->get('api.ip_whitelist', []); $this->passwords = Config::getInstance()->get('api.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'); } }