aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-08-16 12:16:58 +0200
committerGitHub <noreply@github.com>2024-08-16 12:16:58 +0200
commitb8dbed3e32f3e6bdb38209a0f3a8ca7eb5e6a885 (patch)
treef3ec47785bb8f31d3e3e6b32fcf6c730d399ce26 /apps
parent75180a629216af6b6d4b69bd53aab6d161e628c5 (diff)
parent84ee79fe4378bbb10501e940bdcb80462fccb3a5 (diff)
downloadnextcloud-server-b8dbed3e32f3e6bdb38209a0f3a8ca7eb5e6a885.tar.gz
nextcloud-server-b8dbed3e32f3e6bdb38209a0f3a8ca7eb5e6a885.zip
Merge pull request #37761 from nextcloud/invalidateTokensOnlySeenUsers
Diffstat (limited to 'apps')
-rw-r--r--apps/oauth2/lib/Controller/SettingsController.php2
-rw-r--r--apps/oauth2/tests/Controller/SettingsControllerTest.php5
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/oauth2/lib/Controller/SettingsController.php b/apps/oauth2/lib/Controller/SettingsController.php
index 81e728bd693..ce85598d08d 100644
--- a/apps/oauth2/lib/Controller/SettingsController.php
+++ b/apps/oauth2/lib/Controller/SettingsController.php
@@ -69,7 +69,7 @@ class SettingsController extends Controller {
public function deleteClient(int $id): JSONResponse {
$client = $this->clientMapper->getByUid($id);
- $this->userManager->callForAllUsers(function (IUser $user) use ($client) {
+ $this->userManager->callForSeenUsers(function (IUser $user) use ($client) {
$this->tokenProvider->invalidateTokensOfUser($user->getUID(), $client->getName());
});
diff --git a/apps/oauth2/tests/Controller/SettingsControllerTest.php b/apps/oauth2/tests/Controller/SettingsControllerTest.php
index f73703f1929..181cfbfa5b7 100644
--- a/apps/oauth2/tests/Controller/SettingsControllerTest.php
+++ b/apps/oauth2/tests/Controller/SettingsControllerTest.php
@@ -123,10 +123,13 @@ class SettingsControllerTest extends TestCase {
// count other users in the db before adding our own
$count = 0;
$function = function (IUser $user) use (&$count) {
- $count++;
+ if ($user->getLastLogin() > 0) {
+ $count++;
+ }
};
$userManager->callForAllUsers($function);
$user1 = $userManager->createUser('test101', 'test101');
+ $user1->updateLastLoginTimestamp();
$tokenProviderMock = $this->getMockBuilder(IAuthTokenProvider::class)->getMock();
// expect one call per user and ensure the correct client name