From c66c8092f98ae6dd6ea25b978a9cdad528efc657 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 10 May 2013 16:57:39 -0700 Subject: [PATCH] Revert "Return the session_id for validateAuthCode instead of an array" This reverts commit 51138f8738ac82c537da197e09c311f934259100. --- .../OAuth2/Server/Storage/SessionInterface.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/League/OAuth2/Server/Storage/SessionInterface.php b/src/League/OAuth2/Server/Storage/SessionInterface.php index cd328cbb..af4e0e3a 100644 --- a/src/League/OAuth2/Server/Storage/SessionInterface.php +++ b/src/League/OAuth2/Server/Storage/SessionInterface.php @@ -133,18 +133,27 @@ interface SessionInterface * Example SQL query: * * - * SELECT oauth_sessions.id FROM oauth_sessions + * SELECT oauth_sessions.id, oauth_session_authcodes.scope_ids 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 int|bool False if invalid or the session ID + * @return array|bool False if invalid or array as above */ public function validateAuthCode($clientId, $redirectUri, $authCode);