-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathtest-electron.ts
More file actions
26 lines (22 loc) · 880 Bytes
/
test-electron.ts
File metadata and controls
26 lines (22 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { app, BrowserWindow, ipcMain } from "electron";
import { FIDO2Client, PreloadPath } from './index';
app.commandLine.appendSwitch('ignore-certificate-errors')
app.whenReady().then(() => {
let win = new BrowserWindow({
webPreferences: {
nodeIntegration: false,
enableRemoteModule: false,
contextIsolation: false,
preload: PreloadPath,
},
});
win.loadURL('https://webauthn.cybersecvn.com').then(() => {
// win.webContents.openDevTools();
win.maximize();
});
let fido2 = new FIDO2Client({
strictMode: true
});
ipcMain.handle('navigator.credentials.create', (event, options) => fido2.makeCredential(event.sender.getURL(), options));
ipcMain.handle('navigator.credentials.get', (event, options) => fido2.getAssertion(event.sender.getURL(), options));
});