From 2000807f710da6be03b5e5d020056a044c049f63 Mon Sep 17 00:00:00 2001 From: Patrick Pimentel Date: Fri, 2 Jan 2026 19:10:04 -0500 Subject: [PATCH] fix(auth-request-answering): Updated structure of default and web auth request to make more sense. --- .../web-auth-request-answering.service.ts | 11 ----------- .../default-auth-request-answering.service.ts | 12 +++++++++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/apps/web/src/app/auth/core/services/auth-request-answering/web-auth-request-answering.service.ts b/apps/web/src/app/auth/core/services/auth-request-answering/web-auth-request-answering.service.ts index f2ddcd4fbef..cc35f95a7db 100644 --- a/apps/web/src/app/auth/core/services/auth-request-answering/web-auth-request-answering.service.ts +++ b/apps/web/src/app/auth/core/services/auth-request-answering/web-auth-request-answering.service.ts @@ -28,17 +28,6 @@ export class WebAuthRequestAnsweringService ); } - async receivedPendingAuthRequest( - authRequestUserId: UserId, - authRequestId: string, - ): Promise { - this.messagingService.send("openLoginApproval", { - // Include the authRequestId so the DeviceManagementComponent can upsert the correct device. - // This will only matter if the user is on the /device-management screen when the auth request is received. - notificationId: authRequestId, - }); - } - async activeUserMeetsConditionsToShowApprovalDialog(authRequestUserId: UserId): Promise { throw new Error( "activeUserMeetsConditionsToShowApprovalDialog() not implemented for this client", diff --git a/libs/common/src/auth/services/auth-request-answering/default-auth-request-answering.service.ts b/libs/common/src/auth/services/auth-request-answering/default-auth-request-answering.service.ts index 569592e61c2..c06eee8c48d 100644 --- a/libs/common/src/auth/services/auth-request-answering/default-auth-request-answering.service.ts +++ b/libs/common/src/auth/services/auth-request-answering/default-auth-request-answering.service.ts @@ -29,7 +29,7 @@ import { PendingAuthUserMarker, } from "./pending-auth-requests.state"; -export abstract class DefaultAuthRequestAnsweringService implements AuthRequestAnsweringService { +export class DefaultAuthRequestAnsweringService implements AuthRequestAnsweringService { constructor( protected readonly accountService: AccountService, protected readonly authService: AuthService, @@ -38,10 +38,16 @@ export abstract class DefaultAuthRequestAnsweringService implements AuthRequestA protected readonly pendingAuthRequestsState: PendingAuthRequestsStateService, ) {} - abstract receivedPendingAuthRequest( + async receivedPendingAuthRequest( authRequestUserId: UserId, authRequestId: string, - ): Promise; + ): Promise { + this.messagingService.send("openLoginApproval", { + // Include the authRequestId so the DeviceManagementComponent can upsert the correct device. + // This will only matter if the user is on the /device-management screen when the auth request is received. + notificationId: authRequestId, + }); + } async activeUserMeetsConditionsToShowApprovalDialog(authRequestUserId: UserId): Promise { // If the active user is not the intended recipient of the auth request, return false