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/359-error-from-conditional-ui-abort #371

Closed MasterKale closed 1 year ago

MasterKale commented 1 year ago

This PR updates WebAuthnAbortService to abort existing WebAuthn calls with an AbortError instead of a string. This allows for error handlers on startAuthentication() to handle the cancelling of Conditional UI with the same logic that would handle the user cancelling out of the WebAuthn modal experience.

This also fixes accidentally broken AbortError error identification during both registration and authentication, so that the enhanced error codes introduced in #367 can properly identify the throwing of AbortError too:

Screenshot 2023-03-15 at 10 52 26 PM

Fixes #359.