1
0
mirror of https://github.com/bitwarden/jslib synced 2026-01-03 17:13:14 +00:00

[bug] Clear access tokens when loading account state from disk

This commit is contained in:
addison
2021-11-16 10:01:55 -05:00
parent 7458fe4a08
commit 36b52d3594

View File

@@ -52,6 +52,12 @@ export class StateService implements StateServiceAbstraction {
async loadStateFromDisk() {
if (await this.getActiveUserIdFromStorage() != null) {
const diskState = await this.storageService.get<State>('state', await this.defaultOnDiskOptions());
for (const userId in diskState?.accounts) {
if (userId == null) {
continue;
}
diskState.accounts[userId].accessToken = null;
}
this.state = diskState;
await this.storageService.save('state', diskState, await this.defaultOnDiskMemoryOptions());
}