mirror of
https://github.com/bitwarden/server
synced 2025-12-19 17:53:44 +00:00
further validate email for org users
This commit is contained in:
@@ -31,13 +31,15 @@ namespace Bit.Core.Models.Api
|
||||
for(var i = 0; i < Emails.Count(); i++)
|
||||
{
|
||||
var email = Emails.ElementAt(i);
|
||||
if(!attr.IsValid(email))
|
||||
if(!attr.IsValid(email) || email.Contains(" ") || email.Contains("<"))
|
||||
{
|
||||
yield return new ValidationResult($"Email #{i + 1} is not valid.", new string[] { nameof(Emails) });
|
||||
yield return new ValidationResult($"Email #{i + 1} is not valid.",
|
||||
new string[] { nameof(Emails) });
|
||||
}
|
||||
else if(email.Length > 50)
|
||||
{
|
||||
yield return new ValidationResult($"Email #{i + 1} is longer than 50 characters.", new string[] { nameof(Emails) });
|
||||
yield return new ValidationResult($"Email #{i + 1} is longer than 50 characters.",
|
||||
new string[] { nameof(Emails) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user