diff --git a/src/Common/AuthenticatedHttpClient.php b/src/Common/AuthenticatedHttpClient.php index 285ac6b..4d50ad0 100644 --- a/src/Common/AuthenticatedHttpClient.php +++ b/src/Common/AuthenticatedHttpClient.php @@ -72,6 +72,10 @@ public function sendRequest($httpMethod, $resourceName, array $query = [], array $this->authentication->getPassword() ); + if (($token['token'] ?? null) === null) { + throw new \AuthenticateException('Could not get token by username and password.'); + } + $this->authentication ->setJwtToken($token['token']); if (is_callable($this->authentication->tokenUpdateCallback)) {