From daf1104c9bb635ecdcff994b4b1d76f202d09eaa Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Thu, 28 Sep 2023 23:49:34 -0700 Subject: Refine comments --- packages/browser/src/helpers/webAuthnAbortService.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'packages/browser/src') diff --git a/packages/browser/src/helpers/webAuthnAbortService.ts b/packages/browser/src/helpers/webAuthnAbortService.ts index ed007e2..ce6979c 100644 --- a/packages/browser/src/helpers/webAuthnAbortService.ts +++ b/packages/browser/src/helpers/webAuthnAbortService.ts @@ -1,13 +1,10 @@ -/** - * A way to cancel an existing WebAuthn request, for example to cancel a - * WebAuthn autofill authentication request for a manual authentication attempt. - */ class BaseWebAuthnAbortService { private controller: AbortController | undefined; /** * Prepare an abort signal that will help support multiple auth attempts without needing to - * reload the page + * reload the page. This is automatically called whenever `startRegistration()` and + * `startAuthentication()` are called. */ createNewAbortSignal() { // Abort any existing calls to navigator.credentials.create() or navigator.credentials.get() @@ -26,4 +23,11 @@ class BaseWebAuthnAbortService { } } +/** + * A service singleton to help ensure that only a single WebAuthn ceremony is active at a time. + * + * Users of **@simplewebauthn/browser** shouldn't typically need to use this, but it can help e.g. + * developers building projects that use client-side routing to better control the behavior of + * their UX in response to router navigation events. + */ export const WebauthnAbortService = new BaseWebAuthnAbortService(); -- cgit v1.2.3