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
Always renew apppasswords on login
Else you can end up that you renewed your password (LDAP for example).
But they still don't work because you did not use them before you logged
in.

Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer authored and backportbot[bot] committed Feb 10, 2021
commit 0ea266e8bffefef2091b8ad42f08d189107fe7b9
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');
}
}