mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
Do not early return from logout (#7147)
The subsequent path helps to trigger process reload when the active user logs out and the new active is locked.
This commit is contained in:
@@ -891,17 +891,16 @@ export default class MainBackground {
|
||||
//Needs to be checked before state is cleaned
|
||||
const needStorageReseed = await this.needsStorageReseed();
|
||||
|
||||
const currentUserId = await this.stateService.getUserId();
|
||||
const newActiveUser = await this.stateService.clean({ userId: userId });
|
||||
|
||||
if (newActiveUser != null) {
|
||||
// we have a new active user, do not continue tearing down application
|
||||
await this.switchAccount(newActiveUser as UserId);
|
||||
this.messagingService.send("switchAccountFinish");
|
||||
this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId });
|
||||
return;
|
||||
}
|
||||
|
||||
if (userId == null || userId === (await this.stateService.getUserId())) {
|
||||
if (userId == null || userId === currentUserId) {
|
||||
this.searchService.clearIndex();
|
||||
this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user