From 2dcb81d93cb52ce28b1f45a39bc4ca35a8daecd4 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Mon, 29 Apr 2013 11:25:23 +0100 Subject: [PATCH] Updated newAuthoriseRequest --- src/OAuth2/Grant/AuthCode.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/OAuth2/Grant/AuthCode.php b/src/OAuth2/Grant/AuthCode.php index e9044db2..2da7701b 100644 --- a/src/OAuth2/Grant/AuthCode.php +++ b/src/OAuth2/Grant/AuthCode.php @@ -165,14 +165,13 @@ class AuthCode implements GrantTypeInterface { } // 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) - )); + $sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], $type, $typeId); + + // Associate a redirect URI + $this->authServer->getStorage('session')->associateRedirectUri($sessionId, $authParams['redirect_uri']); + + // Associate the auth code + $this->authServer->getStorage('session')->associateAuthCode($sessionId, $authCode, time()+600, implode(',', $scopeIds)); return $authCode; }