app/public/sign.js in clarion-0.1.0 vs app/public/sign.js in clarion-0.2.0
- old
+ new
@@ -24,11 +24,14 @@
}
let cb = (response) => {
console.log(response);
- if (response.errorCode) {
+ if (response.errorCode == window.u2f.ErrorCodes.TIMEOUT) {
+ processionElem.className = 'procession_timeout';
+ return;
+ } else if (response.errorCode) {
processionElem.className = 'procession_error';
return;
}
processionElem.className = 'procession_contact';
@@ -57,11 +60,17 @@
}
});
}).catch(handleError);
};
- processionElem.className = 'procession_wait';
- window.u2f.sign(appId, challenge, requests, cb, 300000);
+ let startRequest = () => {
+ processionElem.className = 'procession_wait';
+ window.u2f.sign(appId, challenge, requests, cb);
+ };
+ document.getElementById("retry_button").addEventListener("click", (e) => {
+ startRequest();
+ });
+ startRequest();
});
});