mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
Fix key rotation being broken due to org ciphers being included (#4522)
This commit is contained in:
parent
59cbe3e428
commit
88d5a97a86
@ -28,12 +28,18 @@ public class CipherRotationValidator : IRotationValidator<IEnumerable<CipherWith
|
||||
var result = new List<Cipher>();
|
||||
|
||||
var existingCiphers = await _cipherRepository.GetManyByUserIdAsync(user.Id, UseFlexibleCollections);
|
||||
if (existingCiphers == null || existingCiphers.Count == 0)
|
||||
if (existingCiphers == null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach (var existing in existingCiphers)
|
||||
var existingUserCiphers = existingCiphers.Where(c => c.OrganizationId == null);
|
||||
if (existingUserCiphers.Count() == 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach (var existing in existingUserCiphers)
|
||||
{
|
||||
var cipher = ciphers.FirstOrDefault(c => c.Id == existing.Id);
|
||||
if (cipher == null)
|
||||
|
Loading…
Reference in New Issue
Block a user