From a1729c97dfd6538977976c098807dda91cf358a7 Mon Sep 17 00:00:00 2001 From: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:14:13 -0400 Subject: [PATCH] PM-4588 - Resolve desktop issue where account menu was disabled after a user JIT provisions into a MP encryption org - simply add a menu redraw call after succesfully setting the MP and relevant keys. (#6717) --- apps/desktop/src/auth/set-password.component.ts | 11 +++++++++++ .../src/auth/components/set-password.component.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/auth/set-password.component.ts b/apps/desktop/src/auth/set-password.component.ts index 989dcc19ce5..c2861e7201b 100644 --- a/apps/desktop/src/auth/set-password.component.ts +++ b/apps/desktop/src/auth/set-password.component.ts @@ -13,6 +13,8 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; +import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; +import { MasterKey, UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key"; import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password"; import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { DialogService } from "@bitwarden/components"; @@ -83,4 +85,13 @@ export class SetPasswordComponent extends BaseSetPasswordComponent implements On onWindowHidden() { this.showPassword = false; } + + protected async onSetPasswordSuccess( + masterKey: MasterKey, + userKey: [UserKey, EncString], + keyPair: [string, EncString] + ): Promise { + await super.onSetPasswordSuccess(masterKey, userKey, keyPair); + this.messagingService.send("redrawMenu"); + } } diff --git a/libs/angular/src/auth/components/set-password.component.ts b/libs/angular/src/auth/components/set-password.component.ts index 29bd1621328..597363fd17e 100644 --- a/libs/angular/src/auth/components/set-password.component.ts +++ b/libs/angular/src/auth/components/set-password.component.ts @@ -168,7 +168,7 @@ export class SetPasswordComponent extends BaseChangePasswordComponent { document.getElementById(confirmField ? "masterPasswordRetype" : "masterPassword").focus(); } - private async onSetPasswordSuccess( + protected async onSetPasswordSuccess( masterKey: MasterKey, userKey: [UserKey, EncString], keyPair: [string, EncString]