Skip to content

Commit 4650ffd

Browse files
authored
using node-onlykey module from GitHub, apple prompt to continue (onlykey#34)
* fix for safari, webauthn call on load disabled * fix for safari, webauthn call on load disabled * fix for safari, webauthn call on load disabled * changes to lib to use node_modules * pull lib from github * fix for apple, prompt to continue
1 parent 4ebc146 commit 4650ffd

4 files changed

Lines changed: 23 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"dependencies": {
4848
"express": "^4.17.1",
4949
"gun": "^0.2020.520",
50+
"node-onlykey": "github:trustcrypto/node-onlykey#043e5d64f12ad90c166c7e04446eefcededd29e6",
5051
"xterm": "^4.8.1",
5152
"xterm-addon-fit": "^0.4.0"
5253
}

src/plugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = [
1111
require("./lib/gun.js"),
1212

1313
/* the onlykey plugin contains the api and other utilities for other plugins */
14-
require("./onlykey-fido2/plugin.js"),
14+
require("node-onlykey/src/onlykey-fido2/plugin.js"),
1515

1616
/* pages plugin is the heart of the app state */
1717
require("./plugins/pages/pages.js"),

src/plugins/index/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,24 @@ module.exports = {
4747
// if(document.hasFocus())//firefox fix, firefox aborts onlykey request when not in focus
4848
if(imports.onlykeyApi.api.extra.getBrowser() !== "Apple")
4949
imports.app.on("start", doSetTime.bind(null, 2000));
50+
else {
51+
// console.log("index_init");
52+
imports.app.onlykeyApi.api.step = function(proceed){
53+
54+
imports.app.bs_modal_dialog.confirm("Continue",
55+
`To continue please click 'Yes' to access OnlyKey via USB`, ["Yes"],
56+
async function(cancel, ans) {
57+
if (ans == "Yes") {
58+
proceed();
59+
}
60+
});
61+
62+
}
63+
64+
imports.app.on("start", doSetTime.bind(null, 2000));
65+
}
66+
67+
5068
// else
5169
// imports.app.on("start",function(){
5270
// if(imports.app.$("#setTime").length == 0)

src/plugins/password-generator/password-generator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ module.exports = {
3030

3131

3232
var onlykey3rd = app.onlykey3rd;
33-
var ok = onlykey3rd(1, 0);
33+
var ok = onlykey3rd();
3434
var $ = app.$;
3535

3636
$("#onlykey_start").click(async function() {
3737
var phrase = $("#phrase").val();
38-
ok.derive_public_key(phrase, function(error, phrasePubkey) {
39-
ok.derive_shared_secret(phrase, phrasePubkey, async function(error, phrasePubkeySecret) {
38+
ok.derive_public_key(phrase,1, false, function(error, phrasePubkey) {
39+
ok.derive_shared_secret(phrase, phrasePubkey, 1, false, async function(error, phrasePubkeySecret) {
4040
$("#phrase_out").val(phrasePubkeySecret);
4141
});
4242
});

0 commit comments

Comments
 (0)