diff --git a/VERSION b/VERSION index 0ea3a94..0c62199 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 +0.2.1 diff --git a/src/V1/V1Client.php b/src/V1/V1Client.php index 08e2609..38dc86a 100644 --- a/src/V1/V1Client.php +++ b/src/V1/V1Client.php @@ -31,10 +31,13 @@ class V1Client { * * @todo Currently there's no format for apps on the server side. * @throws RuntimeException If there is no authenticated entity. - * @return V1User + * @return ?V1User */ - public function me(): V1User { + public function me(): ?V1User { $response = $this->httpClient->request('GET', $this->urls->getApiUrl('/v1/me')); + if($response->getStatusCode() === 401) + return null; + $response->ensureSuccessStatusCode(); $me = $response->getJsonBody();