Merge pull request #33490 from nextcloud/backport/33485/stable24

This commit is contained in:
John Molakvoæ 2022-08-10 12:48:34 +02:00 committed by GitHub
commit e1096357dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -409,9 +409,12 @@ class PublicKeyTokenProvider implements IProvider {
$tokens = $this->mapper->getTokenByUser($uid);
foreach ($tokens as $t) {
$publicKey = $t->getPublicKey();
$t->setPassword($this->encryptPassword($password, $publicKey));
$t->setPasswordInvalid(false);
$this->updateToken($t);
$encryptedPassword = $this->encryptPassword($password, $publicKey);
if ($t->getPassword() !== $encryptedPassword) {
$t->setPassword($encryptedPassword);
$t->setPasswordInvalid(false);
$this->updateToken($t);
}
}
}