Bug 311625
| Summary: | WebAuthn: AbortSignal reason is ignored when rejecting credentials.create() and credentials.get() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Marcos Caceres <marcosc> |
| Component: | WebCore Misc. | Assignee: | Marcos Caceres <marcosc> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Marcos Caceres
When navigator.credentials.create() or navigator.credentials.get() is called with an AbortSignal and the signal is aborted via controller.abort(reason), the returned promise should reject with signal.reason. Instead, WebKit discards the reason and always rejects with a hard-coded AbortError DOMException.
Root cause: AuthenticatorCoordinator.cpp, lines ~251 and ~370:
if (abortSignal && abortSignal->aborted()) {
promise.reject(Exception { ExceptionCode::AbortError, "Aborted by AbortSignal."_s });
The fix is to reject with abortSignal->reason() instead.
Affects both credentials.create() and credentials.get().
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/174220589>
Marcos Caceres
Pull request: https://github.com/WebKit/WebKit/pull/62251
EWS
Committed 310782@main (7a3f4c0ecbd3): <https://commits.webkit.org/310782@main>
Reviewed commits have been landed. Closing PR #62251 and removing active labels.