Parcourir la source

Merge pull request #33485 from nextcloud/bugfix/noid/authtoken-duplicate-update

Do not update passwords if nothing changed
tags/v25.0.0beta1
Julius Härtl il y a 1 an
Parent
révision
7992a3ef50
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 6
    3
      lib/private/Authentication/Token/PublicKeyTokenProvider.php

+ 6
- 3
lib/private/Authentication/Token/PublicKeyTokenProvider.php Voir le fichier

@@ -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);
}
}
}


Chargement…
Annuler
Enregistrer