From 813fa7218a8919cc56446fdf75b0d287fbb7108d Mon Sep 17 00:00:00 2001 From: Umut Korkmaz Date: Thu, 22 Dec 2022 18:58:21 +0300 Subject: [PATCH] fix: (request) catch the failed login --- src/Request.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Request.php b/src/Request.php index c4630ca..af3fa3f 100644 --- a/src/Request.php +++ b/src/Request.php @@ -85,6 +85,10 @@ protected static function ticket($verifySSL, $verifyHost) if (!$response) { throw new ProxmoxException('Request params empty'); } + + if ($response->data === NULL) { + throw new ProxmoxException('Invalid credentials'); + } // set header self::$Client->setHeader('CSRFPreventionToken', $response->data->CSRFPreventionToken);