aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Authentication/Token/PublicKeyTokenProvider.php5
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php18
2 files changed, 1 insertions, 22 deletions
diff --git a/lib/private/Authentication/Token/PublicKeyTokenProvider.php b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
index 38551e63b87..a293d2a8404 100644
--- a/lib/private/Authentication/Token/PublicKeyTokenProvider.php
+++ b/lib/private/Authentication/Token/PublicKeyTokenProvider.php
@@ -414,11 +414,6 @@ class PublicKeyTokenProvider implements IProvider {
public function updatePasswords(string $uid, string $password) {
$this->cache->clear();
- if (!$this->mapper->hasExpiredTokens($uid)) {
- // Nothing to do here
- return;
- }
-
// Update the password for all tokens
$tokens = $this->mapper->getTokenByUser($uid);
foreach ($tokens as $t) {
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
index 04e0fdb527e..f27100b5d78 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
@@ -548,8 +548,7 @@ class PublicKeyTokenProviderTest extends TestCase {
IToken::PERMANENT_TOKEN,
IToken::REMEMBER);
- $this->mapper->expects($this->once())
- ->method('hasExpiredTokens')
+ $this->mapper->method('hasExpiredTokens')
->with($uid)
->willReturn(true);
$this->mapper->expects($this->once())
@@ -564,19 +563,4 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->tokenProvider->updatePasswords($uid, 'bar2');
}
-
- public function testUpdatePasswordsNotRequired() {
- $uid = 'myUID';
-
- $this->mapper->expects($this->once())
- ->method('hasExpiredTokens')
- ->with($uid)
- ->willReturn(false);
- $this->mapper->expects($this->never())
- ->method('getTokenByUser');
- $this->mapper->expects($this->never())
- ->method('update');
-
- $this->tokenProvider->updatePasswords($uid, 'bar2');
- }
}