summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArtur Neumann <artur@jankaritech.com>2022-11-21 17:28:21 +0545
committerArtur Neumann <artur@jankaritech.com>2023-05-19 12:02:05 +0545
commit19bb66a88965aeab3b2f048a20132e528e06baa2 (patch)
tree7cf66ed45527571a0aafb278139a174e532fe81b /apps
parent9f8f2d27b6861ecde0b479db2a9dd3ef0d395d67 (diff)
downloadnextcloud-server-19bb66a88965aeab3b2f048a20132e528e06baa2.tar.gz
nextcloud-server-19bb66a88965aeab3b2f048a20132e528e06baa2.zip
public interface to invalidate tokens of user
Signed-off-by: Artur Neumann <artur@jankaritech.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/oauth2/lib/Controller/SettingsController.php11
1 files changed, 2 insertions, 9 deletions
diff --git a/apps/oauth2/lib/Controller/SettingsController.php b/apps/oauth2/lib/Controller/SettingsController.php
index 872288064dd..c24308140ec 100644
--- a/apps/oauth2/lib/Controller/SettingsController.php
+++ b/apps/oauth2/lib/Controller/SettingsController.php
@@ -30,7 +30,7 @@ declare(strict_types=1);
*/
namespace OCA\OAuth2\Controller;
-use OC\Authentication\Token\IProvider as IAuthTokenProvider;
+use OCP\Authentication\Token\IProvider as IAuthTokenProvider;
use OCA\OAuth2\Db\AccessTokenMapper;
use OCA\OAuth2\Db\Client;
use OCA\OAuth2\Db\ClientMapper;
@@ -106,14 +106,7 @@ class SettingsController extends Controller {
$client = $this->clientMapper->getByUid($id);
$this->userManager->callForAllUsers(function (IUser $user) use ($client) {
- $tokens = $this->tokenProvider->getTokenByUser($user->getUID());
- foreach ($tokens as $token) {
- if ($token->getName() === $client->getName()) {
- $this->tokenProvider->invalidateTokenById(
- $user->getUID(), $token->getId()
- );
- }
- }
+ $this->tokenProvider->invalidateTokensOfUser($user->getUID(), $client->getName());
});
$this->accessTokenMapper->deleteByClientId($id);