mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
e27dd6f7df
Closes #4196 - Clear confidential info on leaving reset route - Remove nested password access, because gross - Also cleaned up some .then(f, h) to .then(f).catch(h) in setup controller
23 lines
601 B
JavaScript
23 lines
601 B
JavaScript
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;
|