Skip to content

Commit

Permalink
Merge pull request #14 from fx88/master
Browse files Browse the repository at this point in the history
Bugfix in getScopes() Bug in Query and Cast the Resultobjects to Arrays
  • Loading branch information
Luca Degasperi committed Oct 16, 2013
2 parents 4e4f1e0 + d20ff61 commit 2e7c1ca
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/LucaDegasperi/OAuth2Server/Repositories/FluentSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,18 @@ public function associateScope($accessTokenId, $scopeId)

public function getScopes($accessToken)
{
return DB::table('oauth_session_token_scopes')
->join('oauth_session_access_tokens', 'oauth_session_token_scopes.session_access_token_id', '=', 'oauth_session_access_tokens.id')
->join('oauth_scopes', 'oauth_session_token_scopes.session_access_token_id', '=', 'oauth_scopes.id')
->where('access_token', $accessToken)
->get();
$scope_query = DB::table('oauth_session_token_scopes')
->join('oauth_session_access_tokens', 'oauth_session_token_scopes.session_access_token_id', '=', 'oauth_session_access_tokens.id')
->join('oauth_scopes', 'oauth_session_token_scopes.scope_id', '=', 'oauth_scopes.id')
->where('access_token', $accessToken)
->get();

foreach($scope_query as $scope)
{
$scopes[]['scope'] = $scope->scope;
}

return $scopes;
}

public function associateAuthCodeScope($authCodeId, $scopeId)
Expand Down

0 comments on commit 2e7c1ca

Please sign in to comment.