Auth/PM-11414 - Fix Web Client Lock Component (#10780)

* PM-11414 - Fix web lock being broken due to missing web implementation for biometric service.

* PM-11414 - Fix import
This commit is contained in:
Jared Snider 2024-08-29 11:18:17 -04:00 committed by GitHub
parent 33f42c7743
commit d4b984f907
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View File

@ -39,6 +39,7 @@ import { I18nService as I18nServiceAbstraction } from "@bitwarden/common/platfor
import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { AbstractStorageService } from "@bitwarden/common/platform/abstractions/storage.service"; import { AbstractStorageService } from "@bitwarden/common/platform/abstractions/storage.service";
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
import { ThemeType } from "@bitwarden/common/platform/enums"; import { ThemeType } from "@bitwarden/common/platform/enums";
import { MemoryStorageService } from "@bitwarden/common/platform/services/memory-storage.service"; import { MemoryStorageService } from "@bitwarden/common/platform/services/memory-storage.service";
// eslint-disable-next-line import/no-restricted-paths -- Implementation for memory storage // eslint-disable-next-line import/no-restricted-paths -- Implementation for memory storage
@ -61,6 +62,7 @@ import { WebSetPasswordJitService, WebRegistrationFinishService } from "../auth"
import { AcceptOrganizationInviteService } from "../auth/organization-invite/accept-organization.service"; import { AcceptOrganizationInviteService } from "../auth/organization-invite/accept-organization.service";
import { HtmlStorageService } from "../core/html-storage.service"; import { HtmlStorageService } from "../core/html-storage.service";
import { I18nService } from "../core/i18n.service"; import { I18nService } from "../core/i18n.service";
import { WebBiometricsService } from "../platform/web-biometric.service";
import { WebEnvironmentService } from "../platform/web-environment.service"; import { WebEnvironmentService } from "../platform/web-environment.service";
import { WebMigrationRunner } from "../platform/web-migration-runner"; import { WebMigrationRunner } from "../platform/web-migration-runner";
import { WebStorageServiceProvider } from "../platform/web-storage-service.provider"; import { WebStorageServiceProvider } from "../platform/web-storage-service.provider";
@ -163,6 +165,11 @@ const safeProviders: SafeProvider[] = [
useClass: WebEnvironmentService, useClass: WebEnvironmentService,
deps: [WINDOW, StateProvider, AccountService], deps: [WINDOW, StateProvider, AccountService],
}), }),
safeProvider({
provide: BiometricsService,
useClass: WebBiometricsService,
deps: [],
}),
safeProvider({ safeProvider({
provide: ThemeStateService, provide: ThemeStateService,
useFactory: (globalStateProvider: GlobalStateProvider) => useFactory: (globalStateProvider: GlobalStateProvider) =>

View File

@ -0,0 +1,27 @@
import { BiometricsService } from "@bitwarden/common/platform/biometrics/biometric.service";
export class WebBiometricsService extends BiometricsService {
async supportsBiometric(): Promise<boolean> {
return false;
}
async isBiometricUnlockAvailable(): Promise<boolean> {
return false;
}
async authenticateBiometric(): Promise<boolean> {
throw new Error("Method not implemented.");
}
async biometricsNeedsSetup(): Promise<boolean> {
throw new Error("Method not implemented.");
}
async biometricsSupportsAutoSetup(): Promise<boolean> {
throw new Error("Method not implemented.");
}
async biometricsSetup(): Promise<void> {
throw new Error("Method not implemented.");
}
}