Skip to content

Commit c4b5304

Browse files
authored
Merge pull request #33489 from nextcloud/backport/33485/stable23
2 parents 21b61ae + f5d91e9 commit c4b5304

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/private/Authentication/Token/PublicKeyTokenProvider.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,12 @@ public function updatePasswords(string $uid, string $password) {
433433
$tokens = $this->mapper->getTokenByUser($uid);
434434
foreach ($tokens as $t) {
435435
$publicKey = $t->getPublicKey();
436-
$t->setPassword($this->encryptPassword($password, $publicKey));
437-
$t->setPasswordInvalid(false);
438-
$this->updateToken($t);
436+
$encryptedPassword = $this->encryptPassword($password, $publicKey);
437+
if ($t->getPassword() !== $encryptedPassword) {
438+
$t->setPassword($encryptedPassword);
439+
$t->setPasswordInvalid(false);
440+
$this->updateToken($t);
441+
}
439442
}
440443
}
441444

0 commit comments

Comments
 (0)