1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00

When deleting an archived clear the archived date so it will be restored to the vault (#6398)

This commit is contained in:
Nick Krantz
2025-09-30 10:04:11 -05:00
committed by GitHub
parent fc07dec3a6
commit 12303b3acf

View File

@@ -721,6 +721,13 @@ public class CipherService : ICipherService
cipherDetails.DeletedDate = cipherDetails.RevisionDate = DateTime.UtcNow;
if (cipherDetails.ArchivedDate.HasValue)
{
// If the cipher was archived, clear the archived date when soft deleting
// If a user were to restore an archived cipher, it should go back to the vault not the archive vault
cipherDetails.ArchivedDate = null;
}
await _cipherRepository.UpsertAsync(cipherDetails);
await _eventService.LogCipherEventAsync(cipherDetails, EventType.Cipher_SoftDeleted);