leapcode/leap_web — pull request #168 by azul (2014-05-29 08:24:19+00:00)
Title: Fix login validations

The validations of user logins, identities and email addresses were somewhat interlinked but not in a clean way and broken.

Now we have the following responsibilities:

User:
* validates that the login format is valid
* validates that the identity (default email address) for the user is valid

Identity:
* validates that the email address is available
* validates that the source and destination emails are valid

Email Addresses:
* validate the format of an email address
* for source email addresses (LocalEmail) they also make sure they end in the providers domain.

Errors are handed on from Email Addresses to Identities to Users when needed.