From a4715bfc3b0e57d73cbf67d58d850e030923b70c Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Mon, 29 Apr 2013 00:00:04 +0100 Subject: [PATCH] Updated create a new session --- src/OAuth2/Grant/AuthCode.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/OAuth2/Grant/AuthCode.php b/src/OAuth2/Grant/AuthCode.php index 3b2d400d..37c540bf 100644 --- a/src/OAuth2/Grant/AuthCode.php +++ b/src/OAuth2/Grant/AuthCode.php @@ -157,8 +157,6 @@ class AuthCode implements GrantTypeInterface { // Remove any old sessions the user might have $this->authServer->getStorage('session')->deleteSession($authParams['client_id'], $type, $typeId); - // Create a new session - $sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], $authParams['redirect_uri'], $type, $typeId, $authCode); // Associate scopes with the new session foreach ($authParams['scopes'] as $scope) @@ -166,6 +164,16 @@ class AuthCode implements GrantTypeInterface { $this->authServer->getStorage('session')->associateScope($sessionId, $scope['id']); } + // Create a new session + $sessionId = $this->authServer->getStorage('session')->createSession(array( + 'client_id' => $authParams['client_id'], + 'owner_type' => $type, + 'owner_id' => $typeId, + 'redirect_uri' =>$authParams['redirect_uri'], + 'auth_code' => $authCode, + 'scope_ids' => implode(',', $scopeIds) + )); + return $authCode; }