Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Make fingerprint optional for browser integration (#234)
Browse files Browse the repository at this point in the history
* Make fingerprint optional for browser integration

* Force focus on biometrics

* Add dependency
  • Loading branch information
Hinton committed Dec 21, 2020
1 parent acdbc22 commit 1742228
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 8 deletions.
83 changes: 80 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"electron-log": "2.2.17",
"electron-store": "1.3.0",
"electron-updater": "4.3.5",
"forcefocus": "^1.1.0",
"form-data": "2.3.2",
"https-proxy-agent": "4.0.0",
"inquirer": "6.2.0",
Expand Down
16 changes: 11 additions & 5 deletions src/electron/biometric.windows.main.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/electron/electronConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
declare function escape(s: string): string;
declare function unescape(s: string): string;
declare module 'duo_web_sdk';
declare module 'forcefocus';

0 comments on commit 1742228

Please sign in to comment.