1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-31 00:33:33 +00:00

fix(auth-request-answering): Updated structure of default and web auth request to make more sense.

This commit is contained in:
Patrick Pimentel
2026-01-02 19:10:04 -05:00
parent 9f14167229
commit 2000807f71
2 changed files with 9 additions and 14 deletions

View File

@@ -28,17 +28,6 @@ export class WebAuthRequestAnsweringService
);
}
async receivedPendingAuthRequest(
authRequestUserId: UserId,
authRequestId: string,
): Promise<void> {
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<boolean> {
throw new Error(
"activeUserMeetsConditionsToShowApprovalDialog() not implemented for this client",

View File

@@ -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<void>;
): Promise<void> {
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<boolean> {
// If the active user is not the intended recipient of the auth request, return false