You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common bug report that we receive is that that the email validator doesn't work correctly, and identifies something as a valid email address when it shouldn't.
This is not a bug and is the correct/intentional behaviour.
The email validator is intentionally naive, and uses the same logic as ASP.NET Core's default [EmailAddress] attribute for consistency, which is just to perform a simple check that a string contains an "@" character. This is explained in our email validator documentation here: https://docs.fluentvalidation.net/en/latest/built-in-validators.html#email-validator
A common bug report that we receive is that that the email validator doesn't work correctly, and identifies something as a valid email address when it shouldn't.
This is not a bug and is the correct/intentional behaviour.
The email validator is intentionally naive, and uses the same logic as ASP.NET Core's default
[EmailAddress]
attribute for consistency, which is just to perform a simple check that a string contains an "@" character. This is explained in our email validator documentation here: https://docs.fluentvalidation.net/en/latest/built-in-validators.html#email-validatorIt is also mentioned in the 9.x upgrade guide, when we switched from a regex to using the simple check:
https://docs.fluentvalidation.net/en/latest/upgrading-to-9.html#default-email-validation-mode-changed
This discussion may also be of interest as to why trying to build comprehensive email validation regex is the wrong approach: https://www.reddit.com/r/csharp/comments/hlzpwn/why_is_emailaddress_attribute_validating_as_true/ (TLDR; the best way to validate email addresses by sending a verification email to the address. At the UI-level just perform a simple/basic check).
The text was updated successfully, but these errors were encountered: