mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-11 13:53:22 +00:00
Use saveAccount to scaffold new account (#245)
This commit is contained in:
@@ -529,12 +529,12 @@ export class StateService
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async scaffoldNewAccountDiskStorage(account: Account): Promise<void> {
|
protected async scaffoldNewAccountDiskStorage(account: Account): Promise<void> {
|
||||||
const storedAccount = await this.getAccount(
|
const storageOptions = this.reconcileOptions(
|
||||||
this.reconcileOptions(
|
{ userId: account.profile.userId },
|
||||||
{ userId: account.profile.userId },
|
await this.defaultOnDiskLocalOptions()
|
||||||
await this.defaultOnDiskLocalOptions()
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const storedAccount = await this.getAccount(storageOptions);
|
||||||
if (storedAccount != null) {
|
if (storedAccount != null) {
|
||||||
account.settings = storedAccount.settings;
|
account.settings = storedAccount.settings;
|
||||||
account.directorySettings = storedAccount.directorySettings;
|
account.directorySettings = storedAccount.directorySettings;
|
||||||
@@ -551,11 +551,7 @@ export class StateService
|
|||||||
await this.storageService.remove(keys.tempDirectoryConfigs);
|
await this.storageService.remove(keys.tempDirectoryConfigs);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.storageService.save(
|
await this.saveAccount(account, storageOptions);
|
||||||
account.profile.userId,
|
|
||||||
account,
|
|
||||||
await this.defaultOnDiskLocalOptions()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async pushAccounts(): Promise<void> {
|
protected async pushAccounts(): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user