mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Biometric support (#470)
* Initial work on windows hello support * Hide login button if not enabled * Add windows.security.credentials.ui dependency to desktop as well. * Only enable biometric on windows. * Add support for dynamic biometric text. * Add untested darwin implementation * Ensure we support biometric before showing login with windows hello / touchid. * Ensure compatability with latest jslib * Only require module on use. * Add windows.security.credentials.ui to src/package.json. * Update requirements * Update consent messages for biometrics
This commit is contained in:
13
src/main.ts
13
src/main.ts
@@ -9,6 +9,7 @@ import { PowerMonitorMain } from './main/powerMonitor.main';
|
||||
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import { BiometricMain } from 'jslib/abstractions/biometric.main';
|
||||
import { ElectronConstants } from 'jslib/electron/electronConstants';
|
||||
import { KeytarStorageListener } from 'jslib/electron/keytarStorageListener';
|
||||
import { ElectronLogService } from 'jslib/electron/services/electronLog.service';
|
||||
@@ -31,6 +32,7 @@ export class Main {
|
||||
menuMain: MenuMain;
|
||||
powerMonitorMain: PowerMonitorMain;
|
||||
trayMain: TrayMain;
|
||||
biometricMain: BiometricMain;
|
||||
|
||||
constructor() {
|
||||
// Set paths for portable builds
|
||||
@@ -105,6 +107,14 @@ export class Main {
|
||||
});
|
||||
|
||||
this.keytarStorageListener = new KeytarStorageListener('Bitwarden');
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
const BiometricWindowsMain = require('jslib/electron/biometric.windows.main').default;
|
||||
this.biometricMain = new BiometricWindowsMain(this.storageService, this.i18nService);
|
||||
} else if (process.platform === 'darwin') {
|
||||
const BiometricDarwinMain = require('jslib/electron/biometric.darwin.main').default;
|
||||
this.biometricMain = new BiometricDarwinMain(this.storageService, this.i18nService);
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap() {
|
||||
@@ -125,6 +135,9 @@ export class Main {
|
||||
}
|
||||
this.powerMonitorMain.init();
|
||||
await this.updaterMain.init();
|
||||
if (this.biometricMain != null) {
|
||||
await this.biometricMain.init();
|
||||
}
|
||||
}, (e: any) => {
|
||||
// tslint:disable-next-line
|
||||
console.error(e);
|
||||
|
||||
Reference in New Issue
Block a user