From e90f00791d1b5a5d615ce194a1ccb2104f3826c1 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 2 Aug 2016 10:34:11 +0200 Subject: [PATCH] add invalidateOldTokens to IProvider interface --- lib/private/Authentication/Token/DefaultTokenCleanupJob.php | 5 ++--- lib/private/Authentication/Token/IProvider.php | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/private/Authentication/Token/DefaultTokenCleanupJob.php b/lib/private/Authentication/Token/DefaultTokenCleanupJob.php index a0af822d986..389a25a9bba 100644 --- a/lib/private/Authentication/Token/DefaultTokenCleanupJob.php +++ b/lib/private/Authentication/Token/DefaultTokenCleanupJob.php @@ -28,9 +28,8 @@ use OC\BackgroundJob\Job; class DefaultTokenCleanupJob extends Job { protected function run($argument) { - /* @var $provider DefaultTokenProvider */ - // TODO: add OC\Authentication\Token\IProvider::invalidateOldTokens and query interface - $provider = OC::$server->query('OC\Authentication\Token\DefaultTokenProvider'); + /* @var $provider IProvider */ + $provider = OC::$server->query('OC\Authentication\Token\IProvider'); $provider->invalidateOldTokens(); } diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php index 4fb2830c3ac..65b515960ea 100644 --- a/lib/private/Authentication/Token/IProvider.php +++ b/lib/private/Authentication/Token/IProvider.php @@ -65,6 +65,11 @@ interface IProvider { */ public function invalidateTokenById(IUser $user, $id); + /** + * Invalidate (delete) old session tokens + */ + public function invalidateOldTokens(); + /** * Save the updated token * -- 2.39.5