Created
April 9, 2019 23:31
-
-
Save orobogenius/fc977891d5b365dec8b0981d47546a46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\OAuth\Bridge\Repositories; | |
use Laravel\Passport\Passport; | |
use League\OAuth2\Server\Entities\ClientEntityInterface; | |
use Laravel\Passport\Bridge\ScopeRepository as PassportScopeRepository; | |
class ScopeRepository extends PassportScopeRepository | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function finalizeScopes( | |
array $scopes, $grantType, | |
ClientEntityInterface $clientEntity, $userIdentifier = null) | |
{ | |
return collect($scopes)->filter(function ($scope) { | |
return Passport::hasScope($scope->getIdentifier()); | |
})->values()->all(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment