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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user