1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-05 03:03:26 +00:00

update authRequestId param requirement and add clarifying comment to desktop

This commit is contained in:
rr-bw
2025-10-29 14:07:25 -07:00
parent faa715c036
commit 7ba4672aa0
4 changed files with 12 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ export class ExtensionAuthRequestAnsweringService
);
}
override async receivedPendingAuthRequest(userId: UserId, authRequestId?: string): Promise<void> {
override async receivedPendingAuthRequest(userId: UserId, authRequestId: string): Promise<void> {
if (!authRequestId) {
throw new Error("authRequestId not found.");
}

View File

@@ -32,7 +32,13 @@ export class DesktopAuthRequestAnsweringService
);
}
override async receivedPendingAuthRequest(userId: UserId): Promise<void> {
/**
* @param userId
* @param _ placeholder for the authRequestId param, which is not used on Desktop because clicks
* on a Desktop notification do not run any auth-request-specific actions. All clicks
* simply open the Desktop window. See electron-main-messaging.service.ts.
*/
override async receivedPendingAuthRequest(userId: UserId, _: string): Promise<void> {
// Always persist the pending marker for this user to global state.
await this.pendingAuthRequestsState.add(userId);

View File

@@ -10,12 +10,12 @@ export abstract class AuthRequestAnsweringService {
* so that even if someone closes a window or a popup and comes back, it could be processed later.
* Only way to clear out the global state is to respond to the auth request.
*
* Currently, this is only implemented for browser extension.
* Currently implemented on Extension and Desktop.
*
* @param userId The UserId that the auth request is for.
* @param authRequestId The id of the auth request that is to be processed.
*/
abstract receivedPendingAuthRequest(userId: UserId, authRequestId?: string): Promise<void>;
abstract receivedPendingAuthRequest(userId: UserId, authRequestId: string): Promise<void>;
/**
* Confirms whether or not the user meets the conditions required to show an approval

View File

@@ -38,7 +38,7 @@ export class DefaultAuthRequestAnsweringService implements AuthRequestAnsweringS
protected readonly pendingAuthRequestsState: PendingAuthRequestsStateService,
) {}
async receivedPendingAuthRequest(userId: UserId): Promise<void> {
async receivedPendingAuthRequest(userId: UserId, authRequestId: string): Promise<void> {
throw new Error("receivedPendingAuthRequest() not implemented for this client");
}
@@ -51,7 +51,7 @@ export class DefaultAuthRequestAnsweringService implements AuthRequestAnsweringS
this.masterPasswordService.forceSetPasswordReason$(userId),
);
// Use must be unlocked, active, and must not be required to set/change their master password
// User must be unlocked, active, and must not be required to set/change their master password
const meetsConditions =
authStatus === AuthenticationStatus.Unlocked &&
activeUserId === userId &&