diff options
Diffstat (limited to 'packages/browser/src/methods')
4 files changed, 8 insertions, 10 deletions
diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts index 11f078e..fb31dcc 100644 --- a/packages/browser/src/methods/startAuthentication.test.ts +++ b/packages/browser/src/methods/startAuthentication.test.ts @@ -11,7 +11,7 @@ import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { WebAuthnError } from '../helpers/webAuthnError'; import { generateCustomError } from '../helpers/__jest__/generateCustomError'; -import { webauthnAbortService } from '../helpers/webAuthnAbortService'; +import { WebAuthnAbortService } from '../helpers/webAuthnAbortService'; import { startAuthentication } from './startAuthentication'; @@ -62,8 +62,7 @@ beforeEach(() => { mockSupportsAutofill.mockResolvedValue(true); // Reset the abort service so we get an accurate call count - // @ts-ignore: Ignore the fact that `controller` is private - webauthnAbortService.controller = undefined; + WebAuthnAbortService.cancelCeremony(); }); afterEach(() => { diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts index f6782ab..6e3940d 100644 --- a/packages/browser/src/methods/startAuthentication.ts +++ b/packages/browser/src/methods/startAuthentication.ts @@ -11,7 +11,7 @@ import { browserSupportsWebAuthn } from '../helpers/browserSupportsWebAuthn'; import { browserSupportsWebAuthnAutofill } from '../helpers/browserSupportsWebAuthnAutofill'; import { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor'; import { identifyAuthenticationError } from '../helpers/identifyAuthenticationError'; -import { webauthnAbortService } from '../helpers/webAuthnAbortService'; +import { WebAuthnAbortService } from '../helpers/webAuthnAbortService'; import { toAuthenticatorAttachment } from '../helpers/toAuthenticatorAttachment'; /** @@ -79,7 +79,7 @@ export async function startAuthentication( // Finalize options options.publicKey = publicKey; // Set up the ability to cancel this request if the user attempts another - options.signal = webauthnAbortService.createNewAbortSignal(); + options.signal = WebAuthnAbortService.createNewAbortSignal(); // Wait for the user to complete assertion let credential; diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts index 97878c6..ee0b604 100644 --- a/packages/browser/src/methods/startRegistration.test.ts +++ b/packages/browser/src/methods/startRegistration.test.ts @@ -8,7 +8,7 @@ import { generateCustomError } from '../helpers/__jest__/generateCustomError'; import { browserSupportsWebAuthn } from '../helpers/browserSupportsWebAuthn'; import { bufferToBase64URLString } from '../helpers/bufferToBase64URLString'; import { WebAuthnError } from '../helpers/webAuthnError'; -import { webauthnAbortService } from '../helpers/webAuthnAbortService'; +import { WebAuthnAbortService } from '../helpers/webAuthnAbortService'; import { utf8StringToBuffer } from '../helpers/utf8StringToBuffer'; @@ -61,8 +61,7 @@ beforeEach(() => { mockSupportsWebauthn.mockReturnValue(true); // Reset the abort service so we get an accurate call count - // @ts-ignore: Ignore the fact that `controller` is private - webauthnAbortService.controller = undefined; + WebAuthnAbortService.cancelCeremony(); }); afterEach(() => { diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index 2ad3089..3ffa7d1 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -11,7 +11,7 @@ import { base64URLStringToBuffer } from '../helpers/base64URLStringToBuffer'; import { browserSupportsWebAuthn } from '../helpers/browserSupportsWebAuthn'; import { toPublicKeyCredentialDescriptor } from '../helpers/toPublicKeyCredentialDescriptor'; import { identifyRegistrationError } from '../helpers/identifyRegistrationError'; -import { webauthnAbortService } from '../helpers/webAuthnAbortService'; +import { WebAuthnAbortService } from '../helpers/webAuthnAbortService'; import { toAuthenticatorAttachment } from '../helpers/toAuthenticatorAttachment'; /** @@ -42,7 +42,7 @@ export async function startRegistration( // Finalize options const options: CredentialCreationOptions = { publicKey }; // Set up the ability to cancel this request if the user attempts another - options.signal = webauthnAbortService.createNewAbortSignal(); + options.signal = WebAuthnAbortService.createNewAbortSignal(); // Wait for the user to complete attestation let credential; |