From 51138f8738ac82c537da197e09c311f934259100 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 10 May 2013 16:53:52 -0700 Subject: [PATCH] Return the session_id for validateAuthCode instead of an array --- .../OAuth2/Server/Storage/SessionInterface.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/League/OAuth2/Server/Storage/SessionInterface.php b/src/League/OAuth2/Server/Storage/SessionInterface.php index af4e0e3a..cd328cbb 100644 --- a/src/League/OAuth2/Server/Storage/SessionInterface.php +++ b/src/League/OAuth2/Server/Storage/SessionInterface.php @@ -133,27 +133,18 @@ interface SessionInterface * Example SQL query: * * - * SELECT oauth_sessions.id, oauth_session_authcodes.scope_ids FROM oauth_sessions + * SELECT oauth_sessions.id FROM oauth_sessions * JOIN oauth_session_authcodes ON oauth_session_authcodes.`session_id` = oauth_sessions.id - * JOIN oauth_session_redirects ON oauth_session_redirects.`session_id` = oauth_sessions.id WHERE - * oauth_sessions.client_id = :clientId AND oauth_session_authcodes.`auth_code` = :authCode + * JOIN oauth_session_redirects ON oauth_session_redirects.`session_id` = oauth_sessions.id + * WHERE oauth_sessions.client_id = :clientId AND oauth_session_authcodes.`auth_code` = :authCode * AND `oauth_session_authcodes`.`auth_code_expires` >= :time AND * `oauth_session_redirects`.`redirect_uri` = :redirectUri * * - * Expected response: - * - * - * array( - * 'id' => (int), // the session ID - * 'scope_ids' => (string) - * ) - * - * * @param string $clientId The client ID * @param string $redirectUri The redirect URI * @param string $authCode The authorization code - * @return array|bool False if invalid or array as above + * @return int|bool False if invalid or the session ID */ public function validateAuthCode($clientId, $redirectUri, $authCode);