RESOLVED FIXED258911
[WebAuthn] .catch() for conditional mediation is not passed the abortreason that was thrown
https://bugs.webkit.org/show_bug.cgi?id=258911
Summary [WebAuthn] .catch() for conditional mediation is not passed the abortreason t...
sweeden
Reported 2023-07-05 22:21:48 PDT
Consider I have a WebAuthn conditional mediation call (with appropriate abortController established), with a catch block such as: navigator.credentials.get(publicKey) .then((assertion) => {}) .catch((error) => {}); This bug is in relation to the type and value of "error" above, when the call is aborted with something like: abortController.abort("AbortError"); According to step 3 of section 2.5.1 of the credential management API (see https://w3c.github.io/webappsec-credential-management/#algorithm-request) if the autofill navigator.credentials.get call is aborted, then the promise should be rejected "with options.signal’s abort reason". According to this reference (https://dom.spec.whatwg.org/#abortsignal-abort-reason) abort reason is "a JavaScript value" - though it is not entirely clear what that means. The way I read it, I would have expected the value of "error" in the catch block to be the string "AbortError" - ie. what is thrown as the reason in the call to abort(), and this is indeed what I see in Chrome. In Safari, typeof(error) returns "object", so the thing passed to the rejected promise is not the plain string abort reason. This lack of consistency makes it difficult to write portable code in the catch block of mediated WebAuthn calls. I'm opening this defect to seek clarification on whether or not this is seen by the WebKit team as a bug, and if not, what the reasoning is.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-07-12 22:22:14 PDT
Marais Rossouw
Comment 2 2024-11-04 19:00:08 PST
EWS
Comment 3 2024-11-05 22:41:30 PST
Committed 286208@main (3b99a41a6e45): <https://commits.webkit.org/286208@main> Reviewed commits have been landed. Closing PR #36172 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.