mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
ad2bfb511f
Closes #2843 * Implemnted the ember validator correctly for both reset request and actual reset (with the token) * added reset validator * changed the request route addresses to be `/authentication/passwordreset` * changed the format of data to be `{ thing: [ {data } ] }` Missing: * notifications * tests for these use cases
16 lines
388 B
JavaScript
16 lines
388 B
JavaScript
var ForgotValidator = Ember.Object.create({
|
|
validate: function (model) {
|
|
var data = model.getProperties('email'),
|
|
validationErrors = [];
|
|
|
|
if (!validator.isEmail(data.email)) {
|
|
validationErrors.push({
|
|
message: 'Invalid Email'
|
|
});
|
|
}
|
|
|
|
return validationErrors;
|
|
}
|
|
});
|
|
|
|
export default ForgotValidator;
|