mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
fix(signalr-premature-closure): [PM-25459] Signalr Closure - Installed the noop auth request answering service properly and made it into a noop. (#16297)
This commit is contained in:
committed by
GitHub
parent
ea1c3252e8
commit
e3f55d793d
@@ -43,11 +43,13 @@ import {
|
|||||||
AccountService,
|
AccountService,
|
||||||
AccountService as AccountServiceAbstraction,
|
AccountService as AccountServiceAbstraction,
|
||||||
} from "@bitwarden/common/auth/abstractions/account.service";
|
} from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
|
import { AuthRequestAnsweringServiceAbstraction } from "@bitwarden/common/auth/abstractions/auth-request-answering/auth-request-answering.service.abstraction";
|
||||||
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||||
import { MasterPasswordApiService } from "@bitwarden/common/auth/abstractions/master-password-api.service.abstraction";
|
import { MasterPasswordApiService } from "@bitwarden/common/auth/abstractions/master-password-api.service.abstraction";
|
||||||
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
||||||
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
|
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
|
||||||
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
|
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
|
||||||
|
import { AuthRequestAnsweringService } from "@bitwarden/common/auth/services/auth-request-answering/auth-request-answering.service";
|
||||||
import {
|
import {
|
||||||
AutofillSettingsService,
|
AutofillSettingsService,
|
||||||
AutofillSettingsServiceAbstraction,
|
AutofillSettingsServiceAbstraction,
|
||||||
@@ -66,7 +68,10 @@ import { KeyGenerationService } from "@bitwarden/common/key-management/crypto";
|
|||||||
import { CryptoFunctionService } from "@bitwarden/common/key-management/crypto/abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "@bitwarden/common/key-management/crypto/abstractions/crypto-function.service";
|
||||||
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
|
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
|
||||||
import { WebCryptoFunctionService } from "@bitwarden/common/key-management/crypto/services/web-crypto-function.service";
|
import { WebCryptoFunctionService } from "@bitwarden/common/key-management/crypto/services/web-crypto-function.service";
|
||||||
import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction";
|
import {
|
||||||
|
InternalMasterPasswordServiceAbstraction,
|
||||||
|
MasterPasswordServiceAbstraction,
|
||||||
|
} from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction";
|
||||||
import { PinServiceAbstraction } from "@bitwarden/common/key-management/pin/pin.service.abstraction";
|
import { PinServiceAbstraction } from "@bitwarden/common/key-management/pin/pin.service.abstraction";
|
||||||
import {
|
import {
|
||||||
VaultTimeoutService,
|
VaultTimeoutService,
|
||||||
@@ -466,6 +471,19 @@ const safeProviders: SafeProvider[] = [
|
|||||||
useClass: InlineDerivedStateProvider,
|
useClass: InlineDerivedStateProvider,
|
||||||
deps: [],
|
deps: [],
|
||||||
}),
|
}),
|
||||||
|
safeProvider({
|
||||||
|
provide: AuthRequestAnsweringServiceAbstraction,
|
||||||
|
useClass: AuthRequestAnsweringService,
|
||||||
|
deps: [
|
||||||
|
AccountServiceAbstraction,
|
||||||
|
ActionsService,
|
||||||
|
AuthService,
|
||||||
|
I18nServiceAbstraction,
|
||||||
|
MasterPasswordServiceAbstraction,
|
||||||
|
PlatformUtilsService,
|
||||||
|
SystemNotificationsService,
|
||||||
|
],
|
||||||
|
}),
|
||||||
safeProvider({
|
safeProvider({
|
||||||
provide: AutofillSettingsServiceAbstraction,
|
provide: AutofillSettingsServiceAbstraction,
|
||||||
useClass: AutofillSettingsService,
|
useClass: AutofillSettingsService,
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ import { WebAuthnLoginServiceAbstraction } from "@bitwarden/common/auth/abstract
|
|||||||
import { AccountApiServiceImplementation } from "@bitwarden/common/auth/services/account-api.service";
|
import { AccountApiServiceImplementation } from "@bitwarden/common/auth/services/account-api.service";
|
||||||
import { AccountServiceImplementation } from "@bitwarden/common/auth/services/account.service";
|
import { AccountServiceImplementation } from "@bitwarden/common/auth/services/account.service";
|
||||||
import { AnonymousHubService } from "@bitwarden/common/auth/services/anonymous-hub.service";
|
import { AnonymousHubService } from "@bitwarden/common/auth/services/anonymous-hub.service";
|
||||||
import { AuthRequestAnsweringService } from "@bitwarden/common/auth/services/auth-request-answering/auth-request-answering.service";
|
import { NoopAuthRequestAnsweringService } from "@bitwarden/common/auth/services/auth-request-answering/noop-auth-request-answering.service";
|
||||||
import { AuthService } from "@bitwarden/common/auth/services/auth.service";
|
import { AuthService } from "@bitwarden/common/auth/services/auth.service";
|
||||||
import { AvatarService } from "@bitwarden/common/auth/services/avatar.service";
|
import { AvatarService } from "@bitwarden/common/auth/services/avatar.service";
|
||||||
import { DefaultActiveUserAccessor } from "@bitwarden/common/auth/services/default-active-user.accessor";
|
import { DefaultActiveUserAccessor } from "@bitwarden/common/auth/services/default-active-user.accessor";
|
||||||
@@ -944,16 +944,8 @@ const safeProviders: SafeProvider[] = [
|
|||||||
}),
|
}),
|
||||||
safeProvider({
|
safeProvider({
|
||||||
provide: AuthRequestAnsweringServiceAbstraction,
|
provide: AuthRequestAnsweringServiceAbstraction,
|
||||||
useClass: AuthRequestAnsweringService,
|
useClass: NoopAuthRequestAnsweringService,
|
||||||
deps: [
|
deps: [],
|
||||||
AccountServiceAbstraction,
|
|
||||||
ActionsService,
|
|
||||||
AuthServiceAbstraction,
|
|
||||||
I18nServiceAbstraction,
|
|
||||||
MasterPasswordServiceAbstraction,
|
|
||||||
PlatformUtilsServiceAbstraction,
|
|
||||||
SystemNotificationsService,
|
|
||||||
],
|
|
||||||
}),
|
}),
|
||||||
safeProvider({
|
safeProvider({
|
||||||
provide: ServerNotificationsService,
|
provide: ServerNotificationsService,
|
||||||
|
|||||||
@@ -3,15 +3,9 @@ import { UserId } from "@bitwarden/user-core";
|
|||||||
|
|
||||||
import { AuthRequestAnsweringServiceAbstraction } from "../../abstractions/auth-request-answering/auth-request-answering.service.abstraction";
|
import { AuthRequestAnsweringServiceAbstraction } from "../../abstractions/auth-request-answering/auth-request-answering.service.abstraction";
|
||||||
|
|
||||||
export class UnsupportedAuthRequestAnsweringService
|
export class NoopAuthRequestAnsweringService implements AuthRequestAnsweringServiceAbstraction {
|
||||||
implements AuthRequestAnsweringServiceAbstraction
|
|
||||||
{
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
async handleAuthRequestNotificationClicked(event: SystemNotificationEvent): Promise<void> {
|
async handleAuthRequestNotificationClicked(event: SystemNotificationEvent): Promise<void> {}
|
||||||
throw new Error("Received pending auth request not supported.");
|
|
||||||
}
|
|
||||||
|
|
||||||
async receivedPendingAuthRequest(userId: UserId, notificationId: string): Promise<void> {
|
async receivedPendingAuthRequest(userId: UserId, notificationId: string): Promise<void> {}
|
||||||
throw new Error("Received pending auth request not supported.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user