From ef4a138237a0f3cb7a2f7be697597771ed3f2233 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 10 May 2013 17:29:28 -0700 Subject: [PATCH] Fixed associateAuthCodeScope() query --- src/League/OAuth2/Server/Storage/PDO/Session.php | 6 +++--- src/League/OAuth2/Server/Storage/SessionInterface.php | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/League/OAuth2/Server/Storage/PDO/Session.php b/src/League/OAuth2/Server/Storage/PDO/Session.php index 7ecdbff2..abde8b2b 100644 --- a/src/League/OAuth2/Server/Storage/PDO/Session.php +++ b/src/League/OAuth2/Server/Storage/PDO/Session.php @@ -161,12 +161,12 @@ class Session implements SessionInterface return ($result === false) ? false : (array) $result; } - public function associateAuthCodeScope($sessionId, $scopeId) + public function associateAuthCodeScope($authCodeId, $scopeId) { $db = \ezcDbInstance::get(); - $stmt = $db->prepare('INSERT INTO `oauth_session_authcode_scopes` (`session_id`, `scope_id`) VALUES (:sessionId, :scopeId)'); - $stmt->bindValue(':sessionId', $sessionId); + $stmt = $db->prepare('INSERT INTO `oauth_session_authcode_scopes` (`oauth_session_authcode_id`, `scope_id`) VALUES (:authCodeId, :scopeId)'); + $stmt->bindValue(':authCodeId', $authCodeId); $stmt->bindValue(':scopeId', $scopeId); $stmt->execute(); } diff --git a/src/League/OAuth2/Server/Storage/SessionInterface.php b/src/League/OAuth2/Server/Storage/SessionInterface.php index 883e87c7..08cd4c53 100644 --- a/src/League/OAuth2/Server/Storage/SessionInterface.php +++ b/src/League/OAuth2/Server/Storage/SessionInterface.php @@ -245,14 +245,15 @@ interface SessionInterface * Example SQL query: * * - * INSERT INTO `oauth_session_authcode_scopes` (`session_id`, `scope_id`) VALUES (:sessionId, :scopeId) + * INSERT INTO `oauth_session_authcode_scopes` (`oauth_session_authcode_id`, `scope_id`) VALUES + * (:authCodeId, :scopeId) * * - * @param int $sessionId The session ID - * @param int $scopeId The scope ID + * @param int $authCodeId The auth code ID + * @param int $scopeId The scope ID * @return void */ - public function associateAuthCodeScope($sessionId, $scopeId); + public function associateAuthCodeScope($authCodeId, $scopeId); /** * Get the scopes associated with an auth code