1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

[Bug] Fix cipher clone yielding incorrect RevisionDate (#1031)

* Fix cipher clone yielding incorrect RevisionDate

* PR fixes

Co-authored-by: Matt Gibson <mdgibson@Matts-MBP.lan>
This commit is contained in:
Matt Gibson
2020-12-07 19:35:34 -06:00
committed by GitHub
parent 8d9b1ff214
commit 7eaf7ab770
5 changed files with 50 additions and 4 deletions

View File

@ -187,7 +187,7 @@ namespace Bit.Api.Controllers
}
// object cannot be a descendant of CipherDetails, so let's clone it.
var cipherClone = CoreHelpers.CloneObject(model.ToCipher(cipher));
var cipherClone = cipher.Clone();
await _cipherService.SaveAsync(cipherClone, userId, model.LastKnownRevisionDate, null, true, false);
var response = new CipherMiniResponseModel(cipherClone, _globalSettings, cipher.OrganizationUseTotp);
@ -276,7 +276,7 @@ namespace Bit.Api.Controllers
throw new NotFoundException();
}
var original = CoreHelpers.CloneObject(cipher);
var original = cipher.Clone();
await _cipherService.ShareAsync(original, model.Cipher.ToCipher(cipher), new Guid(model.Cipher.OrganizationId),
model.CollectionIds.Select(c => new Guid(c)), userId, model.Cipher.LastKnownRevisionDate);