diff --git a/src/Core/Models/Api/Public/Request/MemberCreateRequestModel.cs b/src/Core/Models/Api/Public/Request/MemberCreateRequestModel.cs index 5ebd3f8664..a95d87deb9 100644 --- a/src/Core/Models/Api/Public/Request/MemberCreateRequestModel.cs +++ b/src/Core/Models/Api/Public/Request/MemberCreateRequestModel.cs @@ -27,9 +27,9 @@ namespace Bit.Core.Models.Api.Public yield return new ValidationResult($"Email is not valid.", new string[] { nameof(Email) }); } - else if (Email.Length > 50) + else if (Email.Length > 256) { - yield return new ValidationResult($"Email is longer than 50 characters.", + yield return new ValidationResult($"Email is longer than 256 characters.", new string[] { nameof(Email) }); } } diff --git a/src/Core/Models/Api/Public/Request/OrganizationImportRequestModel.cs b/src/Core/Models/Api/Public/Request/OrganizationImportRequestModel.cs index 45e1403034..058b7be62f 100644 --- a/src/Core/Models/Api/Public/Request/OrganizationImportRequestModel.cs +++ b/src/Core/Models/Api/Public/Request/OrganizationImportRequestModel.cs @@ -66,7 +66,7 @@ namespace Bit.Core.Models.Api.Public /// /// jsmith@example.com [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } /// /// External identifier for reference or linking this member to another system, such as a user directory. diff --git a/src/Core/Models/Api/Request/Accounts/DeleteRecoverRequestModel.cs b/src/Core/Models/Api/Request/Accounts/DeleteRecoverRequestModel.cs index 39721eb25d..f6d19ba7d0 100644 --- a/src/Core/Models/Api/Request/Accounts/DeleteRecoverRequestModel.cs +++ b/src/Core/Models/Api/Request/Accounts/DeleteRecoverRequestModel.cs @@ -6,7 +6,7 @@ namespace Bit.Core.Models.Api { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } } } diff --git a/src/Core/Models/Api/Request/Accounts/EmailRequestModel.cs b/src/Core/Models/Api/Request/Accounts/EmailRequestModel.cs index ced59336af..f29324bf92 100644 --- a/src/Core/Models/Api/Request/Accounts/EmailRequestModel.cs +++ b/src/Core/Models/Api/Request/Accounts/EmailRequestModel.cs @@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string NewEmail { get; set; } [Required] [StringLength(300)] diff --git a/src/Core/Models/Api/Request/Accounts/EmailTokenRequestModel.cs b/src/Core/Models/Api/Request/Accounts/EmailTokenRequestModel.cs index c154bf9db5..4dcd9608b1 100644 --- a/src/Core/Models/Api/Request/Accounts/EmailTokenRequestModel.cs +++ b/src/Core/Models/Api/Request/Accounts/EmailTokenRequestModel.cs @@ -6,7 +6,7 @@ namespace Bit.Core.Models.Api { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string NewEmail { get; set; } [Required] [StringLength(300)] diff --git a/src/Core/Models/Api/Request/Accounts/PasswordHintRequestModel.cs b/src/Core/Models/Api/Request/Accounts/PasswordHintRequestModel.cs index 49b2fce308..b2b8f4c4a5 100644 --- a/src/Core/Models/Api/Request/Accounts/PasswordHintRequestModel.cs +++ b/src/Core/Models/Api/Request/Accounts/PasswordHintRequestModel.cs @@ -6,7 +6,7 @@ namespace Bit.Core.Models.Api { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } } } diff --git a/src/Core/Models/Api/Request/Accounts/PreloginRequestModel.cs b/src/Core/Models/Api/Request/Accounts/PreloginRequestModel.cs index 7ac1386dba..8dc260bf70 100644 --- a/src/Core/Models/Api/Request/Accounts/PreloginRequestModel.cs +++ b/src/Core/Models/Api/Request/Accounts/PreloginRequestModel.cs @@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } } } diff --git a/src/Core/Models/Api/Request/Accounts/RegisterRequestModel.cs b/src/Core/Models/Api/Request/Accounts/RegisterRequestModel.cs index c93c4c548b..58a6db8485 100644 --- a/src/Core/Models/Api/Request/Accounts/RegisterRequestModel.cs +++ b/src/Core/Models/Api/Request/Accounts/RegisterRequestModel.cs @@ -14,7 +14,7 @@ namespace Bit.Core.Models.Api public string Name { get; set; } [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } [Required] [StringLength(1000)] diff --git a/src/Core/Models/Api/Request/EmergencyAccessRequstModels.cs b/src/Core/Models/Api/Request/EmergencyAccessRequstModels.cs index c4a5696214..e423a7a63a 100644 --- a/src/Core/Models/Api/Request/EmergencyAccessRequstModels.cs +++ b/src/Core/Models/Api/Request/EmergencyAccessRequstModels.cs @@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api.Request { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } [Required] public Enums.EmergencyAccessType? Type { get; set; } diff --git a/src/Core/Models/Api/Request/InstallationRequestModel.cs b/src/Core/Models/Api/Request/InstallationRequestModel.cs index 5b27281490..6fdfe7c759 100644 --- a/src/Core/Models/Api/Request/InstallationRequestModel.cs +++ b/src/Core/Models/Api/Request/InstallationRequestModel.cs @@ -7,7 +7,7 @@ namespace Bit.Core.Models.Api { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } public Installation ToInstallation() diff --git a/src/Core/Models/Api/Request/Organizations/ImportOrganizationUsersRequestModel.cs b/src/Core/Models/Api/Request/Organizations/ImportOrganizationUsersRequestModel.cs index 27d5280c84..7ac1db129a 100644 --- a/src/Core/Models/Api/Request/Organizations/ImportOrganizationUsersRequestModel.cs +++ b/src/Core/Models/Api/Request/Organizations/ImportOrganizationUsersRequestModel.cs @@ -42,7 +42,7 @@ namespace Bit.Core.Models.Api public class User : IValidatableObject { [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } public bool Deleted { get; set; } [Required] diff --git a/src/Core/Models/Api/Request/Organizations/OrganizationCreateRequestModel.cs b/src/Core/Models/Api/Request/Organizations/OrganizationCreateRequestModel.cs index af4eecbd2d..e144d31c5f 100644 --- a/src/Core/Models/Api/Request/Organizations/OrganizationCreateRequestModel.cs +++ b/src/Core/Models/Api/Request/Organizations/OrganizationCreateRequestModel.cs @@ -15,7 +15,7 @@ namespace Bit.Core.Models.Api [StringLength(50)] public string BusinessName { get; set; } [Required] - [StringLength(50)] + [StringLength(256)] [EmailAddress] public string BillingEmail { get; set; } public PlanType PlanType { get; set; } diff --git a/src/Core/Models/Api/Request/Organizations/OrganizationUpdateRequestModel.cs b/src/Core/Models/Api/Request/Organizations/OrganizationUpdateRequestModel.cs index 531a33d451..8e3dea6624 100644 --- a/src/Core/Models/Api/Request/Organizations/OrganizationUpdateRequestModel.cs +++ b/src/Core/Models/Api/Request/Organizations/OrganizationUpdateRequestModel.cs @@ -16,7 +16,7 @@ namespace Bit.Core.Models.Api public string Identifier { get; set; } [EmailAddress] [Required] - [StringLength(50)] + [StringLength(256)] public string BillingEmail { get; set; } public Permissions Permissions { get; set; } diff --git a/src/Core/Models/Api/Request/Organizations/OrganizationUserRequestModels.cs b/src/Core/Models/Api/Request/Organizations/OrganizationUserRequestModels.cs index d57df816f1..fa73209adc 100644 --- a/src/Core/Models/Api/Request/Organizations/OrganizationUserRequestModels.cs +++ b/src/Core/Models/Api/Request/Organizations/OrganizationUserRequestModels.cs @@ -38,9 +38,9 @@ namespace Bit.Core.Models.Api yield return new ValidationResult($"Email #{i + 1} is not valid.", new string[] { nameof(Emails) }); } - else if (email.Length > 50) + else if (email.Length > 256) { - yield return new ValidationResult($"Email #{i + 1} is longer than 50 characters.", + yield return new ValidationResult($"Email #{i + 1} is longer than 256 characters.", new string[] { nameof(Emails) }); } } diff --git a/src/Core/Models/Api/Request/TwoFactorRequestModels.cs b/src/Core/Models/Api/Request/TwoFactorRequestModels.cs index ad60e9dfca..e6bf6bacc4 100644 --- a/src/Core/Models/Api/Request/TwoFactorRequestModels.cs +++ b/src/Core/Models/Api/Request/TwoFactorRequestModels.cs @@ -199,7 +199,7 @@ namespace Bit.Core.Models.Api { [Required] [EmailAddress] - [StringLength(50)] + [StringLength(256)] public string Email { get; set; } public User ToUser(User extistingUser)