diff options
author | Matthew Miller <matthew@millerti.me> | 2023-03-15 21:23:02 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2023-03-15 21:23:02 -0700 |
commit | b0fab5c583110f41dde3394712c90e90576b5f70 (patch) | |
tree | 83cef1e1aa6e521aa1bcd8b4d05bca78aad85762 /packages/browser/src | |
parent | cc6b4e83d0c8087f78c1851a5b0f60a1d7223ec6 (diff) |
Raise an AbortError when cancelling existing call
Diffstat (limited to 'packages/browser/src')
-rw-r--r-- | packages/browser/src/helpers/webAuthnAbortService.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/browser/src/helpers/webAuthnAbortService.ts b/packages/browser/src/helpers/webAuthnAbortService.ts index 8955526..f90b263 100644 --- a/packages/browser/src/helpers/webAuthnAbortService.ts +++ b/packages/browser/src/helpers/webAuthnAbortService.ts @@ -12,7 +12,9 @@ class WebAuthnAbortService { createNewAbortSignal() { // Abort any existing calls to navigator.credentials.create() or navigator.credentials.get() if (this.controller) { - this.controller.abort('Cancelling existing WebAuthn API call for new one'); + const abortError = new Error('Cancelling existing WebAuthn API call for new one'); + abortError.name = 'AbortError'; + this.controller.abort(abortError); } const newController = new AbortController(); |