Merge pull request #37761 from nextcloud/invalidateTokensOnlySeenUsers

pull/47038/head
John Molakvoæ 9 months ago committed by GitHub
commit b8dbed3e32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/oauth2/lib/Controller/SettingsController.php
  2. 5
      apps/oauth2/tests/Controller/SettingsControllerTest.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());
});

@ -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

Loading…
Cancel
Save