Clear provider state on logout (#8563)

This commit is contained in:
Addison Beck 2024-04-05 13:10:55 -05:00 committed by GitHub
parent 2ff990edd2
commit 6df52262a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 5 deletions

View File

@ -1143,7 +1143,6 @@ export default class MainBackground {
this.vaultTimeoutSettingsService.clear(userId), this.vaultTimeoutSettingsService.clear(userId),
this.vaultFilterService.clear(), this.vaultFilterService.clear(),
this.biometricStateService.logout(userId), this.biometricStateService.logout(userId),
this.providerService.save(null, userId),
/* We intentionally do not clear: /* We intentionally do not clear:
* - autofillSettingsService * - autofillSettingsService
* - badgeSettingsService * - badgeSettingsService

View File

@ -703,7 +703,6 @@ export class Main {
this.folderService.clear(userId), this.folderService.clear(userId),
this.collectionService.clear(userId as UserId), this.collectionService.clear(userId as UserId),
this.passwordGenerationService.clear(), this.passwordGenerationService.clear(),
this.providerService.save(null, userId as UserId),
]); ]);
await this.stateEventRunnerService.handleEvent("logout", userId as UserId); await this.stateEventRunnerService.handleEvent("logout", userId as UserId);

View File

@ -584,7 +584,6 @@ export class AppComponent implements OnInit, OnDestroy {
await this.passwordGenerationService.clear(userBeingLoggedOut); await this.passwordGenerationService.clear(userBeingLoggedOut);
await this.vaultTimeoutSettingsService.clear(userBeingLoggedOut); await this.vaultTimeoutSettingsService.clear(userBeingLoggedOut);
await this.biometricStateService.logout(userBeingLoggedOut as UserId); await this.biometricStateService.logout(userBeingLoggedOut as UserId);
await this.providerService.save(null, userBeingLoggedOut as UserId);
await this.stateEventRunnerService.handleEvent("logout", userBeingLoggedOut as UserId); await this.stateEventRunnerService.handleEvent("logout", userBeingLoggedOut as UserId);

View File

@ -1,13 +1,14 @@
import { Observable, map, firstValueFrom, of, switchMap, take } from "rxjs"; import { Observable, map, firstValueFrom, of, switchMap, take } from "rxjs";
import { KeyDefinition, PROVIDERS_DISK, StateProvider } from "../../platform/state"; import { UserKeyDefinition, PROVIDERS_DISK, StateProvider } from "../../platform/state";
import { UserId } from "../../types/guid"; import { UserId } from "../../types/guid";
import { ProviderService as ProviderServiceAbstraction } from "../abstractions/provider.service"; import { ProviderService as ProviderServiceAbstraction } from "../abstractions/provider.service";
import { ProviderData } from "../models/data/provider.data"; import { ProviderData } from "../models/data/provider.data";
import { Provider } from "../models/domain/provider"; import { Provider } from "../models/domain/provider";
export const PROVIDERS = KeyDefinition.record<ProviderData>(PROVIDERS_DISK, "providers", { export const PROVIDERS = UserKeyDefinition.record<ProviderData>(PROVIDERS_DISK, "providers", {
deserializer: (obj: ProviderData) => obj, deserializer: (obj: ProviderData) => obj,
clearOn: ["logout"],
}); });
function mapToSingleProvider(providerId: string) { function mapToSingleProvider(providerId: string) {