Ghost/core/client/validators/forgotten.js
Robert Jackson bdbc689232
Update validation to match server error.
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.
2014-07-30 19:07:42 -04:00

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;