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:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user