diff options
author | Jarrett Helton <jaydhelton@gmail.com> | 2021-08-24 18:40:09 -0400 |
---|---|---|
committer | Jarrett Helton <jaydhelton@gmail.com> | 2021-08-24 18:40:09 -0400 |
commit | 22260e63c0b2a91d8f5db4000304e73b2bff9277 (patch) | |
tree | 87c3ecded4690c29cb474d0d6cd69d5ac7ef5fe6 /packages/browser/src/methods | |
parent | 2bb27c6febdbacbd7bbe4356318a6b3fa6fd84db (diff) | |
parent | 30ecc73b9856747337523f1e367b10d9d96a4a95 (diff) |
Merge remote-tracking branch 'origin/master' into v4/rename-methods-and-types
Diffstat (limited to 'packages/browser/src/methods')
4 files changed, 10 insertions, 10 deletions
diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts index 96b140c..acd97c3 100644 --- a/packages/browser/src/methods/startAuthentication.test.ts +++ b/packages/browser/src/methods/startAuthentication.test.ts @@ -5,16 +5,16 @@ import { AuthenticationExtensionsClientOutputs, } from '@simplewebauthn/typescript-types'; -import supportsWebauthn from '../helpers/supportsWebauthn'; +import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; import startAuthentication from './startAuthentication'; -jest.mock('../helpers/supportsWebauthn'); +jest.mock('../helpers/browserSupportsWebauthn'); const mockNavigatorGet = window.navigator.credentials.get as jest.Mock; -const mockSupportsWebauthn = supportsWebauthn as jest.Mock; +const mockSupportsWebauthn = browserSupportsWebauthn as jest.Mock; const mockAuthenticatorData = 'mockAuthenticatorData'; const mockClientDataJSON = 'mockClientDataJSON'; diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts index 1f431f5..277b8f0 100644 --- a/packages/browser/src/methods/startAuthentication.ts +++ b/packages/browser/src/methods/startAuthentication.ts @@ -7,7 +7,7 @@ import { import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; import base64URLStringToBuffer from '../helpers/base64URLStringToBuffer'; import bufferToUTF8String from '../helpers/bufferToUTF8String'; -import supportsWebauthn from '../helpers/supportsWebauthn'; +import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; /** @@ -18,7 +18,7 @@ import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDes export default async function startAuthentication( requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON, ): Promise<AuthenticationCredentialJSON> { - if (!supportsWebauthn()) { + if (!browserSupportsWebauthn()) { throw new Error('WebAuthn is not supported in this browser'); } diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts index 3567b02..2569a99 100644 --- a/packages/browser/src/methods/startRegistration.test.ts +++ b/packages/browser/src/methods/startRegistration.test.ts @@ -6,15 +6,15 @@ import { } from '@simplewebauthn/typescript-types'; import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; -import supportsWebauthn from '../helpers/supportsWebauthn'; +import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; import startRegistration from './startRegistration'; -jest.mock('../helpers/supportsWebauthn'); +jest.mock('../helpers/browserSupportsWebauthn'); const mockNavigatorCreate = window.navigator.credentials.create as jest.Mock; -const mockSupportsWebauthn = supportsWebauthn as jest.Mock; +const mockSupportsWebauthn = browserSupportsWebauthn as jest.Mock; const mockAttestationObject = 'mockAtte'; const mockClientDataJSON = 'mockClie'; diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index 1bb5c34..eec07c5 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -7,7 +7,7 @@ import { import utf8StringToBuffer from '../helpers/utf8StringToBuffer'; import bufferToBase64URLString from '../helpers/bufferToBase64URLString'; import base64URLStringToBuffer from '../helpers/base64URLStringToBuffer'; -import supportsWebauthn from '../helpers/supportsWebauthn'; +import { browserSupportsWebauthn } from '../helpers/browserSupportsWebauthn'; import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDescriptor'; /** @@ -18,7 +18,7 @@ import toPublicKeyCredentialDescriptor from '../helpers/toPublicKeyCredentialDes export default async function startRegistration( creationOptionsJSON: PublicKeyCredentialCreationOptionsJSON, ): Promise<RegistrationCredentialJSON> { - if (!supportsWebauthn()) { + if (!browserSupportsWebauthn()) { throw new Error('WebAuthn is not supported in this browser'); } |