1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Fixes for StrictEmailAddressAttribute (#1474)

* Use StrictEmail validation for changing email

* Add trailing symbols to illegal chars in emails

* Add semicolon as always illegal

* Replace regex with MimeKit parsing, add unit test

* Add more unit tests

* Fix linting
This commit is contained in:
Thomas Rittson
2021-07-23 05:59:10 +10:00
committed by GitHub
parent 7a135ae7cd
commit 757102fd96
3 changed files with 65 additions and 7 deletions

View File

@ -1,11 +1,12 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Api
{
public class EmailTokenRequestModel
{
[Required]
[EmailAddress]
[StrictEmailAddress]
[StringLength(256)]
public string NewEmail { get; set; }
[Required]