chore: 🤖 reset password before executing function
This commit is contained in:
2 files changed
+8
-24
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user