diff --git a/ui/core/app/components/form/account/password/index.js b/ui/core/app/components/form/account/password/index.js index 02f208746..e80e48c95 100644 --- a/ui/core/app/components/form/account/password/index.js +++ b/ui/core/app/components/form/account/password/index.js @@ -30,13 +30,8 @@ export default class FormAccountPasswordIndexComponent extends Component { */ @action submit(fn) { - try { - this.args.model.isNew ? fn(this.password) : fn(); - } catch (e) { - // We want to guarantee password is unset - this.resetPassword(); - // But we don't want to silence the error - throw e; - } + const password = this.password; + this.resetPassword(); + this.args.model.isNew ? fn(password) : fn(); } } diff --git a/ui/core/app/components/form/account/password/set-password/index.js b/ui/core/app/components/form/account/password/set-password/index.js index 2449d4c6f..477c14cee 100644 --- a/ui/core/app/components/form/account/password/set-password/index.js +++ b/ui/core/app/components/form/account/password/set-password/index.js @@ -39,14 +39,9 @@ export default class FormAccountPasswordSetPasswordIndexComponent extends Compon */ @action submit(fn) { - try { - fn(this.password); - } catch (e) { - // We want to guarantee password is unset - this.resetPassword(); - // But we don't want to silence the error - throw e; - } + const password = this.password; + this.resetPassword(); + fn(password); } /** @@ -55,14 +50,8 @@ export default class FormAccountPasswordSetPasswordIndexComponent extends Compon */ @action cancel(fn) { - try { - fn(); - } catch (e) { - // We want to guarantee password is unset - this.resetPassword(); - // But we don't want to silence the error - throw e; - } + this.resetPassword(); + fn(); } }