allways extract scopes from repository

This commit is contained in:
Julián Gutiérrez
2016-03-15 01:10:47 +01:00
parent 5ae9827d67
commit 592f60de70
16 changed files with 78 additions and 64 deletions
+10 -3
View File
@@ -48,9 +48,16 @@ class RefreshTokenGrant extends AbstractGrant
// If no new scopes are requested then give the access token the original session scopes
if (count($scopes) === 0) {
$scopes = array_map(function ($scopeId) {
$scope = new ScopeEntity();
$scope->setIdentifier($scopeId);
$scopes = array_map(function ($scopeId) use ($client) {
$scope = $this->scopeRepository->getScopeEntityByIdentifier(
$scopeId,
$this->getIdentifier(),
$client->getIdentifier()
);
if (!$scope) {
throw OAuthServerException::invalidScope($scopeId);
}
return $scope;
}, $oldRefreshToken['scopes']);