1
0
mirror of https://github.com/bitwarden/server synced 2026-01-19 17:03:16 +00:00

normalize authentication field evaluation order

This commit is contained in:
✨ Audrey ✨
2025-06-26 16:56:14 -04:00
parent 2d625f6e6e
commit cc712970f7

View File

@@ -217,19 +217,23 @@ public class SendRequestModel
existingSend.ExpirationDate = ExpirationDate;
existingSend.DeletionDate = DeletionDate.Value;
existingSend.MaxAccessCount = MaxAccessCount;
if (!string.IsNullOrWhiteSpace(Password))
{
existingSend.Password = authorizationService.HashPassword(Password);
}
else if (!string.IsNullOrWhiteSpace(Emails))
if (!string.IsNullOrWhiteSpace(Emails))
{
// normalize encoding
var emails = Emails.Split(',', RemoveEmptyEntries | TrimEntries);
existingSend.Emails = string.Join(", ", emails);
existingSend.Password = null;
}
else if (!string.IsNullOrWhiteSpace(Password))
{
existingSend.Password = authorizationService.HashPassword(Password);
existingSend.Emails = null;
}
existingSend.Disabled = Disabled.GetValueOrDefault();
existingSend.HideEmail = HideEmail.GetValueOrDefault();
return existingSend;
}