diff --git a/src/Http/Middleware/CheckClientCredentials.php b/src/Http/Middleware/CheckClientCredentials.php index a24959dbe..b666c2c57 100644 --- a/src/Http/Middleware/CheckClientCredentials.php +++ b/src/Http/Middleware/CheckClientCredentials.php @@ -17,7 +17,7 @@ class CheckClientCredentials extends CheckCredentials */ protected function validateCredentials($token) { - if (! $token || $token->client->firstParty()) { + if (! $token || ! $token->client || $token->client->firstParty()) { throw new AuthenticationException; } } diff --git a/src/Http/Middleware/CheckClientCredentialsForAnyScope.php b/src/Http/Middleware/CheckClientCredentialsForAnyScope.php index e1f7b23ff..8576183d7 100644 --- a/src/Http/Middleware/CheckClientCredentialsForAnyScope.php +++ b/src/Http/Middleware/CheckClientCredentialsForAnyScope.php @@ -17,7 +17,7 @@ class CheckClientCredentialsForAnyScope extends CheckCredentials */ protected function validateCredentials($token) { - if (! $token || $token->client->firstParty()) { + if (! $token || ! $token->client || $token->client->firstParty()) { throw new AuthenticationException; } }