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

check for UserId in ReplaceAsync (#6176)

This commit is contained in:
Jordan Aasen
2025-08-25 14:00:41 -07:00
committed by GitHub
parent a7fc89a5bb
commit a4c4d0157b

View File

@@ -552,6 +552,8 @@ public class CipherRepository : Repository<Core.Vault.Entities.Cipher, Cipher, G
var dbContext = GetDatabaseContext(scope);
var entity = await dbContext.Ciphers.FindAsync(cipher.Id);
if (entity != null)
{
if (cipher.UserId.HasValue)
{
if (cipher.Favorite)
{
@@ -605,7 +607,7 @@ public class CipherRepository : Repository<Core.Vault.Entities.Cipher, Cipher, G
cipher.Folders = JsonSerializer.Serialize(folders);
}
}
}
// Check if this cipher is a part of an organization, and if so do
// not save the UserId into the database. This must be done after we
// set the user specific data like Folders and Favorites because