From 43da67ee511aa83b45dfa93b223ea9d13f808d4a Mon Sep 17 00:00:00 2001 From: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:12:59 -0400 Subject: [PATCH] Fix nativeMessaging background by replacing removed state service usage with account service for user id retrieval (#10501) --- apps/browser/src/background/nativeMessaging.background.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/background/nativeMessaging.background.ts b/apps/browser/src/background/nativeMessaging.background.ts index 55374709601..777af9538b0 100644 --- a/apps/browser/src/background/nativeMessaging.background.ts +++ b/apps/browser/src/background/nativeMessaging.background.ts @@ -337,7 +337,8 @@ export class NativeMessagingBackground { // Verify key is correct by attempting to decrypt a secret try { - await this.cryptoService.getFingerprint(await this.stateService.getUserId()); + const userId = (await firstValueFrom(this.accountService.activeAccount$))?.id; + await this.cryptoService.getFingerprint(userId); } catch (e) { this.logService.error("Unable to verify key: " + e); await this.cryptoService.clearKeys();