0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

Merge pull request #6231 from kevinansfield/fix-password-reset

Fix password reset
This commit is contained in:
Hannah Wolfe 2015-12-16 08:54:53 +00:00
commit 8e3f614a90
2 changed files with 6 additions and 3 deletions

View file

@ -37,7 +37,7 @@ export default Controller.extend(ValidationEngine, {
let credentials = this.getProperties('newPassword', 'ne2Password', 'token');
this.set('flowErrors', '');
this.get('hasValidated').addObjects((['newPassword', 'ne2Password']));
this.get('hasValidated').addObjects(['newPassword', 'ne2Password']);
this.validate().then(() => {
this.toggleProperty('submitting');
ajax({
@ -54,7 +54,7 @@ export default Controller.extend(ValidationEngine, {
this.get('notifications').showAPIError(response, {key: 'password.reset'});
this.toggleProperty('submitting');
});
}).catch(() => {
}).catch((error) => {
if (this.get('errors.newPassword')) {
this.set('flowErrors', this.get('errors.newPassword')[0].message);
}
@ -62,6 +62,10 @@ export default Controller.extend(ValidationEngine, {
if (this.get('errors.ne2Password')) {
this.set('flowErrors', this.get('errors.ne2Password')[0].message);
}
if (this.get('errors.length') === 0) {
throw error;
}
});
}
}

View file

@ -19,7 +19,6 @@ export default Route.extend(styleBody, {
},
setupController(controller, params) {
this._super(...arguments);
controller.token = params.token;
},