mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
bdbc689232
When a using the forgottenRoute if you enter an incorrectly formatted email address you would see the error message 'Invalid Email', however if you entered an email address that was correctly formatted but missing the error message would be 'Invalid email address'. This fixes the discrepancy.
17 lines
393 B
JavaScript
17 lines
393 B
JavaScript
var ForgotValidator = Ember.Object.create({
|
|
check: function (model) {
|
|
var data = model.getProperties('email'),
|
|
validationErrors = [];
|
|
|
|
if (!validator.isEmail(data.email)) {
|
|
validationErrors.push({
|
|
message: 'Invalid email address'
|
|
});
|
|
}
|
|
|
|
return validationErrors;
|
|
}
|
|
});
|
|
|
|
export default ForgotValidator;
|