for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Rinvex\Oauth\Http\Middleware;
use Illuminate\Auth\AuthenticationException;
use Rinvex\Oauth\Exceptions\MissingScopeException;
class CheckClientCredentials extends CheckCredentials
{
/**
* Validate token credentials.
*
* @param \Rinvex\Oauth\Models\AccessToken $accessToken
* @throws \Illuminate\Auth\AuthenticationException
* @return void
*/
protected function validateCredentials($accessToken)
if (! $accessToken) {
throw new AuthenticationException();
}
* @param array $scopes
* @throws \Rinvex\Oauth\Exceptions\MissingScopeException
protected function validateScopes($accessToken, $scopes)
foreach ($scopes as $scope) {
if (! $accessToken->abilities->map->getRouteKey()->contains($scope)) {
throw new MissingScopeException($scope);