diff options
4 files changed, 18 insertions, 3 deletions
diff --git a/packages/browser/src/helpers/webAuthnAbortService.ts b/packages/browser/src/helpers/webAuthnAbortService.ts index 479df55..8955526 100644 --- a/packages/browser/src/helpers/webAuthnAbortService.ts +++ b/packages/browser/src/helpers/webAuthnAbortService.ts @@ -15,8 +15,10 @@ class WebAuthnAbortService { this.controller.abort('Cancelling existing WebAuthn API call for new one'); } - this.controller = new AbortController(); - return this.controller.signal; + const newController = new AbortController(); + + this.controller = newController; + return newController.signal; } } diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts index e112124..9ebdd77 100644 --- a/packages/browser/src/methods/startAuthentication.test.ts +++ b/packages/browser/src/methods/startAuthentication.test.ts @@ -116,6 +116,7 @@ test('should return base64url-encoded response values', async () => { }, getClientExtensionResults: () => ({}), type: 'webauthn.get', + authenticatorAttachment: '', }); }); }); @@ -163,7 +164,9 @@ test('should send extensions to authenticator if present in options', async () = const extensions: AuthenticationExtensionsClientInputs = { credProps: true, appid: 'appidHere', + // @ts-ignore uvm: true, + // @ts-ignore appidExclude: 'appidExcludeHere', }; const optsWithExts: PublicKeyCredentialRequestOptionsJSON = { diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts index 2dc11be..38ea52e 100644 --- a/packages/browser/src/methods/startRegistration.test.ts +++ b/packages/browser/src/methods/startRegistration.test.ts @@ -96,9 +96,14 @@ test('should return base64url-encoded response values', async () => { response: { attestationObject: Buffer.from(mockAttestationObject, 'ascii'), clientDataJSON: Buffer.from(mockClientDataJSON, 'ascii'), + getTransports: () => [], + getAuthenticatorData: () => new Uint8Array(), + getPublicKey: () => null, + getPublicKeyAlgorithm: () => -999, }, getClientExtensionResults: () => ({}), type: 'webauthn.create', + authenticatorAttachment: '', }); }); }); @@ -132,7 +137,9 @@ test('should send extensions to authenticator if present in options', async () = const extensions: AuthenticationExtensionsClientInputs = { credProps: true, appid: 'appidHere', + // @ts-ignore uvm: true, + // @ts-ignore appidExclude: 'appidExcludeHere', }; const optsWithExts: PublicKeyCredentialCreationOptionsJSON = { diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index be935a4..59e3442 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -95,7 +95,10 @@ export interface AuthenticationCredentialJSON * are Base64URL-encoded in the browser so that they can be sent as JSON to the server. */ export interface AuthenticatorAttestationResponseJSON - extends Omit<AuthenticatorAttestationResponseFuture, 'clientDataJSON' | 'attestationObject'> { + extends Omit< + AuthenticatorAttestationResponseFuture, + 'clientDataJSON' | 'attestationObject' | 'getTransports' | 'getAuthenticatorData' | 'getPublicKey' | 'getPublicKeyAlgorithm' + > { clientDataJSON: Base64URLString; attestationObject: Base64URLString; } |