Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/private/Authentication/Token/PublicKeyTokenProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,6 @@ public function markPasswordInvalid(IToken $token, string $tokenId) {
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) {
Expand Down
18 changes: 1 addition & 17 deletions tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,7 @@ public function testUpdatePasswords() {
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())
Expand All @@ -564,19 +563,4 @@ public function testUpdatePasswords() {

$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');
}
}