PM-7392 - Add optional user id to logout callbacks.
This commit is contained in:
parent
89d2d5ec4a
commit
279ac758ce
|
@ -598,7 +598,7 @@ export default class MainBackground {
|
|||
return Promise.resolve();
|
||||
},
|
||||
this.logService,
|
||||
(logoutReason: LogoutReason) => this.logout(logoutReason),
|
||||
(logoutReason: LogoutReason, userId?: UserId) => this.logout(logoutReason, userId),
|
||||
);
|
||||
|
||||
this.domainSettingsService = new DefaultDomainSettingsService(this.stateProvider);
|
||||
|
@ -1226,7 +1226,6 @@ export default class MainBackground {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: figure out what this should look like
|
||||
async logout(logoutReason: LogoutReason, userId?: UserId) {
|
||||
const activeUserId = await firstValueFrom(
|
||||
this.accountService.activeAccount$.pipe(
|
||||
|
@ -1297,6 +1296,7 @@ export default class MainBackground {
|
|||
this.messagingService.send("switchAccountFinish");
|
||||
} else {
|
||||
this.messagingService.send("doneLoggingOut", {
|
||||
logoutReason: logoutReason,
|
||||
userId: userBeingLoggedOut,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { LogoutReason } from "@bitwarden/auth/common";
|
||||
import { ApiService as AbstractApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { ApiService } from "@bitwarden/common/services/api.service";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
|
||||
import {
|
||||
tokenServiceFactory,
|
||||
|
@ -27,7 +28,7 @@ import { stateServiceFactory, StateServiceInitOptions } from "./state-service.fa
|
|||
type ApiServiceFactoryOptions = FactoryOptions & {
|
||||
apiServiceOptions: {
|
||||
refreshAccessTokenErrorCallback?: () => Promise<void>;
|
||||
logoutCallback: (logoutReason: LogoutReason) => Promise<void>;
|
||||
logoutCallback: (logoutReason: LogoutReason, userId?: UserId) => Promise<void>;
|
||||
customUserAgent?: string;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -32,6 +32,7 @@ import { DefaultSingleUserStateProvider } from "@bitwarden/common/platform/state
|
|||
import { DefaultStateProvider } from "@bitwarden/common/platform/state/implementations/default-state.provider";
|
||||
import { StateEventRegistrarService } from "@bitwarden/common/platform/state/state-event-registrar.service";
|
||||
import { MemoryStorageService as MemoryStorageServiceForStateProviders } from "@bitwarden/common/platform/state/storage/memory-storage.service";
|
||||
import { UserId } from "@bitwarden/common/types/guid";
|
||||
/* eslint-enable import/no-restricted-paths */
|
||||
|
||||
import { DesktopAutofillSettingsService } from "./autofill/services/desktop-autofill-settings.service";
|
||||
|
@ -204,7 +205,7 @@ export class Main {
|
|||
this.keyGenerationService,
|
||||
this.encryptService,
|
||||
this.logService,
|
||||
async (logoutReason: LogoutReason) => {},
|
||||
async (logoutReason: LogoutReason, userId?: UserId) => {},
|
||||
);
|
||||
|
||||
this.migrationRunner = new MigrationRunner(
|
||||
|
|
Loading…
Reference in New Issue