From aa9bae61469c5508140a930a8505c9e384dbf34b Mon Sep 17 00:00:00 2001 From: Patrick Pimentel Date: Tue, 2 Sep 2025 15:58:33 -0400 Subject: [PATCH] fix(extension-device-approval): [PM-14943] Answering Service Full Implementation - Active user id will no longer throw. --- .../auth-request-answering/auth-request-answering.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/common/src/auth/services/auth-request-answering/auth-request-answering.service.ts b/libs/common/src/auth/services/auth-request-answering/auth-request-answering.service.ts index d8b2b4eb5f5..63f7d37dff3 100644 --- a/libs/common/src/auth/services/auth-request-answering/auth-request-answering.service.ts +++ b/libs/common/src/auth/services/auth-request-answering/auth-request-answering.service.ts @@ -5,7 +5,7 @@ import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthServerNotificationTags } from "@bitwarden/common/auth/enums/auth-server-notification-tags"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason"; -import { getUserId } from "@bitwarden/common/auth/services/account.service"; +import { getOptionalUserId, getUserId } from "@bitwarden/common/auth/services/account.service"; import { MasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; @@ -41,7 +41,7 @@ export class AuthRequestAnsweringService implements AuthRequestAnsweringServiceA { userId, authRequestId }, ); const authStatus = await firstValueFrom(this.authService.activeAccountStatus$); - const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)); + const activeUserId: UserId | null = await firstValueFrom(this.accountService.activeAccount$.pipe(getOptionalUserId)); const forceSetPasswordReason = await firstValueFrom( this.masterPasswordService.forceSetPasswordReason$(userId), );