diff --git a/ghost/admin/app/controllers/reset.js b/ghost/admin/app/controllers/reset.js index 5f997e780c..29a2b97204 100644 --- a/ghost/admin/app/controllers/reset.js +++ b/ghost/admin/app/controllers/reset.js @@ -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; + } }); } } diff --git a/ghost/admin/app/routes/reset.js b/ghost/admin/app/routes/reset.js index e8793dd866..711359eb44 100644 --- a/ghost/admin/app/routes/reset.js +++ b/ghost/admin/app/routes/reset.js @@ -19,7 +19,6 @@ export default Route.extend(styleBody, { }, setupController(controller, params) { - this._super(...arguments); controller.token = params.token; },