Merge pull request #191 from hashicorp/fix-set-password

Fix set password
This commit is contained in:
Randall Morey authored and GitHub committed 2020-09-16 13:56:00 -04:00
commit e2610d6a90
3 files changed
+6 -4

No files matched your search

@@ -1,6 +1,7 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { next } from '@ember/runloop';
export default class FormAccountPasswordIndexComponent extends Component {
@@ -31,7 +32,7 @@ export default class FormAccountPasswordIndexComponent extends Component {
@action
submit(fn) {
const password = this.password;
this.resetPassword();
next(() => this.resetPassword());
this.args.model.isNew ? fn(password) : fn();
}
}
@@ -2,6 +2,7 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { computed } from '@ember/object';
import { action } from '@ember/object';
import { next } from '@ember/runloop';
export default class FormAccountPasswordSetPasswordIndexComponent extends Component {
@@ -40,7 +41,7 @@ export default class FormAccountPasswordSetPasswordIndexComponent extends Compon
@action
submit(fn) {
const password = this.password;
this.resetPassword();
next(() => this.resetPassword());
fn(password);
}
@@ -31,9 +31,9 @@ export default class ScopesScopeAuthMethodsAuthMethodAccountsAccountSettingsRout
* @param {string} password
*/
@action
async setPassword(account) {
async setPassword(account, password) {
try {
await account.setPassword();
await account.setPassword(password);
await this.replaceWith('scopes.scope.auth-methods.auth-method.accounts.account.set-password');
this.notify.success(
this.intl.t('notify.save-success')