MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.62k stars 137 forks source link

fix: hide errors when get-public-key is not supported #439

Closed unix closed 1 year ago

unix commented 1 year ago

Changes

Methods getPublicKey and getPublicKeyAlgorithm may still return function type in unsupported environments and only throw an error when called, for this reason we manually ignore this error.

Refs

MasterKale commented 1 year ago

Thank you for the PR, @unix. Can you please add some tests? If you rebase off of master you shouldn't have any issues running server's tests locally now.

unix commented 1 year ago

@MasterKale I rebase to the latest code (from master), but I can hardly run all the test cases, which contain a lot of type errors. It seems that the coupling between the organization of the project and the monorepo is a little strange.

I am not sure if the try catch will affect the original test cases (it may not seem like it), but I am unable to run existing test cases correctly, making it even more difficult to add test cases. It would be very helpful if you could take over this PR.

aemr3 commented 1 year ago

@MasterKale we have this issue too. could you please look into this PR? thanks

MasterKale commented 1 year ago

I'm going to find time this week to take this work over.

MasterKale commented 1 year ago

Thank you again for your contribution @unix. I gave you a shout-out in #443 as it's pretty much this PR but with tests, so I'm marking this one as superseded by the new PR. Thanks for understanding ✌️