Open 0xdeafcafe opened 5 years ago
I'm not familiar with the 'as SignResponse' syntax, but simplifying your example to:
window.u2f.sign('https://u2fdemo.appspot.com', 'asdf', [], res => {console.log(res)}, 2);
seems to work and logs the timeout error after 2 seconds.
The SignResponse
is just from typescript definitions (from https://github.com/lgarron/u2f-api-polyfill.d.ts) however as these are just definitions they should have no impact on the logic.
I'll try setting it to 2 tomorrow, but when I tried setting it to anything it was just failing.
Ok, not really knowing Typescript, it seems like SignResponse only covers success cases, and this is a failure case so none of the fields match what you are assigning it to.
I'm specifying a custom timeout like so:
However, when the timeout is hit it throws this error to the console:
Error in event handler for (unknown): TypeError: Cannot read property 'write' of undefined