Skip to content

Commit

Permalink
Fix scope comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgarlag committed May 21, 2019
1 parent 7548051 commit 4a72527
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions League/Repository/ScopeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ private function setupScopes(ClientModel $client, array $requestedScopes): array
}

$finalizedScopes = [];
$clientScopesAsStrings = array_map('strval', $clientScopes);

foreach ($requestedScopes as $requestedScope) {
if (!\in_array($requestedScope, $clientScopes, true)) {
throw OAuthServerException::invalidScope((string) $requestedScope);
$requestedScopeAsString = (string) $requestedScope;
if (!\in_array($requestedScopeAsString, $clientScopesAsStrings, true)) {
throw OAuthServerException::invalidScope($requestedScopeAsString);
}

$finalizedScopes[] = $requestedScope;
Expand Down

0 comments on commit 4a72527

Please sign in to comment.