0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/app/validators/reset.js

24 lines
628 B
JavaScript
Raw Normal View History

2015-02-12 21:22:32 -07:00
import Ember from 'ember';
var ResetValidator = Ember.Object.create({
check: function (model) {
var p1 = model.get('newPassword'),
p2 = model.get('ne2Password'),
validationErrors = [];
if (!validator.equals(p1, p2)) {
validationErrors.push({
message: 'The two new passwords don\'t match.'
});
}
if (!validator.isLength(p1, 8)) {
validationErrors.push({
message: 'The password is not long enough.'
});
}
return validationErrors;
}
});
export default ResetValidator;