diff --git a/apps/desktop/src/platform/main/biometric/biometric.noop.main.ts b/apps/desktop/src/platform/main/biometric/biometric.noop.main.ts new file mode 100644 index 0000000000..152b5ce32f --- /dev/null +++ b/apps/desktop/src/platform/main/biometric/biometric.noop.main.ts @@ -0,0 +1,34 @@ +import { OsBiometricService } from "./biometrics.service.abstraction"; + +export default class NoopBiometricsService implements OsBiometricService { + constructor() {} + + async init() {} + + async osSupportsBiometric(): Promise { + return false; + } + + async getBiometricKey( + service: string, + storageKey: string, + clientKeyHalfB64: string, + ): Promise { + return null; + } + + async setBiometricKey( + service: string, + storageKey: string, + value: string, + clientKeyPartB64: string | undefined, + ): Promise { + return; + } + + async deleteBiometricKey(service: string, key: string): Promise {} + + async authenticateBiometric(): Promise { + throw new Error("Not supported on this platform"); + } +} diff --git a/apps/desktop/src/platform/main/biometric/biometrics.service.ts b/apps/desktop/src/platform/main/biometric/biometrics.service.ts index ea223c8914..54b8487175 100644 --- a/apps/desktop/src/platform/main/biometric/biometrics.service.ts +++ b/apps/desktop/src/platform/main/biometric/biometrics.service.ts @@ -27,6 +27,8 @@ export class BiometricsService implements BiometricsServiceAbstraction { this.loadWindowsHelloService(); } else if (platform === "darwin") { this.loadMacOSService(); + } else { + this.loadNoopBiometricsService(); } } @@ -47,6 +49,12 @@ export class BiometricsService implements BiometricsServiceAbstraction { this.platformSpecificService = new BiometricDarwinMain(this.i18nService, this.stateService); } + private loadNoopBiometricsService() { + // eslint-disable-next-line + const NoopBiometricsService = require("./biometric.noop.main").default; + this.platformSpecificService = new NoopBiometricsService(); + } + async init() { return await this.platformSpecificService.init(); }