From 7f7f45662a4f7847b57e69831b03dfd9883f7ea5 Mon Sep 17 00:00:00 2001 From: Norbert Fuksz Date: Mon, 2 Mar 2015 17:47:48 +0000 Subject: [PATCH] Fixed missing session scope Close #297 --- src/Grant/AuthCodeGrant.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index 46ceb0620..c0af6b75a 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -148,7 +148,6 @@ public function newAuthorizeRequest($type, $typeId, $authParams = []) $session = new SessionEntity($this->server); $session->setOwner($type, $typeId); $session->associateClient($authParams['client']); - $session->save(); // Create a new auth code $authCode = new AuthCodeEntity($this->server); @@ -158,8 +157,10 @@ public function newAuthorizeRequest($type, $typeId, $authParams = []) foreach ($authParams['scopes'] as $scope) { $authCode->associateScope($scope); + $session->associateScope($scope); } + $session->save(); $authCode->setSession($session); $authCode->save();