From 1c5d2390872182fc75aabcc90295e8738908886a Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 6 Jul 2012 19:28:09 +0100 Subject: [PATCH] Fixed brace placement --- src/oauth2server/Server.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/oauth2server/Server.php b/src/oauth2server/Server.php index 27baf1b0..ea78fb12 100644 --- a/src/oauth2server/Server.php +++ b/src/oauth2server/Server.php @@ -192,10 +192,11 @@ class Server foreach ($authoriseParams['scopes'] as $scope) { - if ( ! in_array($scope, $originalScopes)) - { + if ( ! in_array($scope, $originalScopes)) { + throw new OAuthServerClientException('invalid_scope: ' . $this->errors['invalid_scope']); + } } @@ -208,10 +209,9 @@ class Server $authoriseParams['scopes'], $accessToken); return $authCode; - } + + } else { - else - { $authCode = $this->newAuthCode($authoriseParams['client_id'], 'user', $typeId, $authoriseParams['redirect_uri'], $authoriseParams['scopes']); @@ -268,9 +268,10 @@ class Server ); // Add the scopes - foreach ($scopes as $scope) - { + foreach ($scopes as $scope) { + $this->db->addSessionScope($sessionId, $scope); + } }