diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index c9af632126..0b92fab894 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -42,7 +42,6 @@ import { ELECTRON_SUPPORTS_SECURE_STORAGE } from "./platform/services/electron-p import { ElectronStateService } from "./platform/services/electron-state.service"; import { ElectronStorageService } from "./platform/services/electron-storage.service"; import { I18nMainService } from "./platform/services/i18n.main.service"; -import { IllegalSecureStorageService } from "./platform/services/illegal-secure-storage-service"; import { ElectronMainMessagingService } from "./services/electron-main-messaging.service"; export class Main { @@ -148,14 +147,11 @@ export class Main { this.environmentService = new EnvironmentService(stateProvider, accountService); - // Note: secure storage service is not available and should not be called in the main background process. - const illegalSecureStorageService = new IllegalSecureStorageService(); - this.tokenService = new TokenService( singleUserStateProvider, globalStateProvider, ELECTRON_SUPPORTS_SECURE_STORAGE, - illegalSecureStorageService, + this.storageService, ); this.migrationRunner = new MigrationRunner( diff --git a/apps/desktop/src/platform/services/illegal-secure-storage-service.ts b/apps/desktop/src/platform/services/illegal-secure-storage-service.ts deleted file mode 100644 index 12f86226be..0000000000 --- a/apps/desktop/src/platform/services/illegal-secure-storage-service.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AbstractStorageService } from "@bitwarden/common/platform/abstractions/storage.service"; -import { StorageOptions } from "@bitwarden/common/platform/models/domain/storage-options"; - -export class IllegalSecureStorageService implements AbstractStorageService { - constructor() {} - - get valuesRequireDeserialization(): boolean { - throw new Error("Method not implemented."); - } - has(key: string, options?: StorageOptions): Promise { - throw new Error("Method not implemented."); - } - save(key: string, obj: T, options?: StorageOptions): Promise { - throw new Error("Method not implemented."); - } - async get(key: string): Promise { - throw new Error("Method not implemented."); - } - async set(key: string, obj: T): Promise { - throw new Error("Method not implemented."); - } - async remove(key: string): Promise { - throw new Error("Method not implemented."); - } - async clear(): Promise { - throw new Error("Method not implemented."); - } -} diff --git a/libs/angular/src/services/jslib-services.module.ts b/libs/angular/src/services/jslib-services.module.ts index 2ff90b79a4..b153c8219b 100644 --- a/libs/angular/src/services/jslib-services.module.ts +++ b/libs/angular/src/services/jslib-services.module.ts @@ -485,7 +485,12 @@ const typesafeProviders: Array = [ safeProvider({ provide: TokenServiceAbstraction, useClass: TokenService, - deps: [SingleUserStateProvider, GlobalStateProvider, SUPPORTS_SECURE_STORAGE, SECURE_STORAGE], + deps: [ + SingleUserStateProvider, + GlobalStateProvider, + SUPPORTS_SECURE_STORAGE, + AbstractStorageService, + ], }), safeProvider({ provide: KeyGenerationServiceAbstraction,