From 89850420f6e0d65f542aff8015d52ebbbbfb051b Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sun, 5 May 2013 18:09:47 +0100 Subject: [PATCH] Updated query to return session details --- src/OAuth2/Storage/PDO/Session.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/OAuth2/Storage/PDO/Session.php b/src/OAuth2/Storage/PDO/Session.php index e3df933d..7a24d388 100644 --- a/src/OAuth2/Storage/PDO/Session.php +++ b/src/OAuth2/Storage/PDO/Session.php @@ -209,13 +209,12 @@ class Session implements SessionInterface { $db = \ezcDbInstance::get(); - $stmt = $db->prepare('SELECT session_id FROM `oauth_session_access_tokens` WHERE - access_token = :accessToken AND access_token_expires >= ' . time()); + $stmt = $db->prepare('SELECT session_id, oauth_sessions.`client_id`, oauth_sessions.`owner_id`, oauth_sessions.`owner_type` FROM `oauth_session_access_tokens` JOIN oauth_sessions ON oauth_sessions.`id` = session_id WHERE access_token = :accessToken AND access_token_expires >= ' . time()); $stmt->bindValue(':accessToken', $accessToken); $stmt->execute(); $result = $stmt->fetchObject(); - return ($result === false) ? false : $result->session_id; + return ($result === false) ? false : (array) $result; } /**