mirror of
https://github.com/bitwarden/browser
synced 2026-01-03 17:13:47 +00:00
Make fingerprint optional for browser integration (#234)
* Make fingerprint optional for browser integration * Force focus on biometrics * Add dependency
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
import { I18nService, StorageService } from '../abstractions';
|
||||
|
||||
import { ipcMain } from 'electron';
|
||||
import { BiometricMain } from '../abstractions/biometric.main';
|
||||
import { ConstantsService } from '../services';
|
||||
import forceFocus from 'forcefocus';
|
||||
|
||||
import { ElectronConstants } from './electronConstants';
|
||||
import { WindowMain } from './window.main';
|
||||
|
||||
import { BiometricMain } from '../abstractions/biometric.main';
|
||||
import { I18nService } from '../abstractions/i18n.service';
|
||||
import { StorageService } from '../abstractions/storage.service';
|
||||
import { ConstantsService } from '../services/constants.service';
|
||||
|
||||
export default class BiometricWindowsMain implements BiometricMain {
|
||||
isError: boolean = false;
|
||||
|
||||
private windowsSecurityCredentialsUiModule: any;
|
||||
|
||||
constructor(private storageService: StorageService, private i18nservice: I18nService) { }
|
||||
constructor(private storageService: StorageService, private i18nservice: I18nService, private windowMain: WindowMain) { }
|
||||
|
||||
async init() {
|
||||
this.windowsSecurityCredentialsUiModule = this.getWindowsSecurityCredentialsUiModule();
|
||||
@@ -89,6 +93,8 @@ export default class BiometricWindowsMain implements BiometricMain {
|
||||
}
|
||||
return resolve(result);
|
||||
});
|
||||
|
||||
forceFocus.focusWindow(this.windowMain.win);
|
||||
} catch (error) {
|
||||
this.isError = true;
|
||||
return reject(error);
|
||||
|
||||
@@ -7,6 +7,7 @@ export class ElectronConstants {
|
||||
static readonly minimizeOnCopyToClipboardKey: string = 'minimizeOnCopyToClipboardKey';
|
||||
static readonly enableBiometric: string = 'enabledBiometric';
|
||||
static readonly enableBrowserIntegration: string = 'enableBrowserIntegration';
|
||||
static readonly enableBrowserIntegrationFingerprint: string = 'enableBrowserIntegrationFingerprint'
|
||||
static readonly alwaysShowDock: string = 'alwaysShowDock';
|
||||
static readonly openAtLogin: string = 'openAtLogin';
|
||||
}
|
||||
|
||||
1
src/globals.d.ts
vendored
1
src/globals.d.ts
vendored
@@ -1,3 +1,4 @@
|
||||
declare function escape(s: string): string;
|
||||
declare function unescape(s: string): string;
|
||||
declare module 'duo_web_sdk';
|
||||
declare module 'forcefocus';
|
||||
|
||||
Reference in New Issue
Block a user