summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArtur Neumann <artur@jankaritech.com>2022-11-21 17:28:21 +0545
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-03-14 17:13:29 +0100
commitf634badf1218baff90acde501859081e3765d79f (patch)
treeb38c95825cc82e6497da36e742952fecc8452ae0 /apps
parent21be557e2afe9e3a1e024d9618a377816d73d63a (diff)
downloadnextcloud-server-f634badf1218baff90acde501859081e3765d79f.tar.gz
nextcloud-server-f634badf1218baff90acde501859081e3765d79f.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);