diff --git a/lib/Service/NetworkService.php b/lib/Service/NetworkService.php index e54ea1b..5a443cb 100644 --- a/lib/Service/NetworkService.php +++ b/lib/Service/NetworkService.php @@ -154,6 +154,9 @@ public function oauthRequest(string $userId, string $endPoint, array $params = [ $method, returnRaw: true, ); + if (is_array($response)) { + return $response; + } $body = $response->getBody(); $respCode = $response->getStatusCode(); $headers = $response->getHeaders(); @@ -222,7 +225,7 @@ private function refreshToken(string $userId): bool { $this->logger->error( 'Token is not valid anymore. Impossible to refresh it. ' . $result['error'] . ' ' - . $result['error_description'] ?? '[no error description]', + . ($result['error_description'] ?? '[no error description]'), ['app' => Application::APP_ID] ); return false;