While building out several custom community portals recently I noticed that the SF userame can have multiple @
's in the username field. Although it forces you to have at least 1 of them, and if you don't the platform says the username must be in the format of an email address.
But it does not enforce the same validation that it forces on email fields. In particular I can have several @
's throughout the username, but as long as there is at least 1 it doesn't show an error.
Whereas the email field will tell you it is improperly formatted when trying to save it.
Granted the invalid user name says ...in the form of...
, rather than Invalid Email Address
.
The only reason I could think to allow this behavior is to permit people to use their email addresses as a username when appending a suffix to the email that may have the @
in it to identify what portal a user belongs to. But that seems like a bit of a stretch.
Why does the username field behave this way?
@
restriction at all in the username