Added removeRefreshToken method to SessionInterface

This commit is contained in:
Alex Bilbie 2013-05-09 11:40:29 -07:00
parent 76f2f6a5e1
commit 6d8eb9d05e
2 changed files with 23 additions and 0 deletions

View File

@ -125,6 +125,15 @@ class Session implements SessionInterface
return ($result === false) ? false : (array) $result;
}
public function removeRefreshToken($refreshToken)
{
$db = \ezcDbInstance::get();
$stmt = $db->prepare('DELETE FROM `oauth_session_refresh_tokens` WHERE refresh_token = :refreshToken');
$stmt->bindValue(':refreshToken', $refreshToken);
$stmt->execute();
}
public function validateRefreshToken($refreshToken, $clientId)
{
$db = \ezcDbInstance::get();

View File

@ -185,6 +185,20 @@ interface SessionInterface
*/
public function validateAccessToken($accessToken);
/**
* Removes a refresh token
*
* Example SQL query:
*
* <code>
* DELETE FROM `oauth_session_refresh_tokens` WHERE refresh_token = :refreshToken
* </code>
*
* @param string $refreshToken The refresh token to be removed
* @return void
*/
public function removeRefreshToken($refreshToken);
/**
* Validate a refresh token
*