mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
[PM-6037] Fix process reload not triggering on inactive account lock/logout (#9805)
* Send loggedOut/locked events on logout/lock event
* Revert "Send loggedOut/locked events on logout/lock event"
This reverts commit 293f2d6131.
* Ensure loggedOut is sent for non-active user logouts too
* Make loggedOut accept userIds
* Add userBeingLoggedOut in desktop app component
* Await updateconnection calls
This commit is contained in:
@@ -194,9 +194,9 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
break;
|
||||
case "loggedOut":
|
||||
this.modalService.closeAll();
|
||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.notificationsService.updateConnection();
|
||||
if (message.userId == null || message.userId === this.activeUserId) {
|
||||
await this.notificationsService.updateConnection();
|
||||
}
|
||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.updateAppMenu();
|
||||
@@ -694,9 +694,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
|
||||
// This must come last otherwise the logout will prematurely trigger
|
||||
// a process reload before all the state service user data can be cleaned up
|
||||
if (userBeingLoggedOut === activeUserId) {
|
||||
this.authService.logOut(async () => {});
|
||||
}
|
||||
this.authService.logOut(async () => {}, userBeingLoggedOut);
|
||||
}
|
||||
|
||||
private async recordActivity() {
|
||||
|
||||
@@ -119,9 +119,12 @@ export class AppComponent implements OnDestroy, OnInit {
|
||||
this.notificationsService.updateConnection(false);
|
||||
break;
|
||||
case "loggedOut":
|
||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.notificationsService.updateConnection(false);
|
||||
if (
|
||||
message.userId == null ||
|
||||
message.userId === (await firstValueFrom(this.accountService.activeAccount$))
|
||||
) {
|
||||
await this.notificationsService.updateConnection(false);
|
||||
}
|
||||
break;
|
||||
case "unlocked":
|
||||
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
||||
@@ -311,7 +314,7 @@ export class AppComponent implements OnDestroy, OnInit {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.router.navigate(["/"]);
|
||||
}
|
||||
});
|
||||
}, userId);
|
||||
}
|
||||
|
||||
private async recordActivity() {
|
||||
|
||||
Reference in New Issue
Block a user