浏览代码

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 1年前
父节点
当前提交
7992a3ef50
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6
    3
      lib/private/Authentication/Token/PublicKeyTokenProvider.php

+ 6
- 3
lib/private/Authentication/Token/PublicKeyTokenProvider.php 查看文件

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


正在加载...
取消
保存