Updated create a new session

This commit is contained in:
Alex Bilbie 2013-04-29 00:00:04 +01:00
parent 4ef8030a93
commit a4715bfc3b

View File

@ -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;
}