mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Fix password reset
closes #6229 - removes `_super` call in the reset route's `setupController` hook to avoid a `model` property being set which was being picked up by the validation engine - throw the error if we fail in the password reset process from something we aren't expecting
This commit is contained in:
parent
513ed0834b
commit
b006eda9f0
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ export default Route.extend(styleBody, {
|
||||
},
|
||||
|
||||
setupController(controller, params) {
|
||||
this._super(...arguments);
|
||||
controller.token = params.token;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user