mirror of
https://github.com/bitwarden/server
synced 2026-01-20 01:13:18 +00:00
normalize authentication field evaluation order
This commit is contained in:
@@ -217,19 +217,23 @@ public class SendRequestModel
|
|||||||
existingSend.ExpirationDate = ExpirationDate;
|
existingSend.ExpirationDate = ExpirationDate;
|
||||||
existingSend.DeletionDate = DeletionDate.Value;
|
existingSend.DeletionDate = DeletionDate.Value;
|
||||||
existingSend.MaxAccessCount = MaxAccessCount;
|
existingSend.MaxAccessCount = MaxAccessCount;
|
||||||
if (!string.IsNullOrWhiteSpace(Password))
|
|
||||||
{
|
if (!string.IsNullOrWhiteSpace(Emails))
|
||||||
existingSend.Password = authorizationService.HashPassword(Password);
|
|
||||||
}
|
|
||||||
else if (!string.IsNullOrWhiteSpace(Emails))
|
|
||||||
{
|
{
|
||||||
// normalize encoding
|
// normalize encoding
|
||||||
var emails = Emails.Split(',', RemoveEmptyEntries | TrimEntries);
|
var emails = Emails.Split(',', RemoveEmptyEntries | TrimEntries);
|
||||||
existingSend.Emails = string.Join(", ", emails);
|
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.Disabled = Disabled.GetValueOrDefault();
|
||||||
existingSend.HideEmail = HideEmail.GetValueOrDefault();
|
existingSend.HideEmail = HideEmail.GetValueOrDefault();
|
||||||
|
|
||||||
return existingSend;
|
return existingSend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user