diff options
author | Matthew Miller <matthew@millerti.me> | 2022-11-12 19:51:29 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-11-12 19:51:29 -0800 |
commit | 6e3db9655c6aa2aef590c66295df500271bfdd17 (patch) | |
tree | 03ac98e1da17f97c4f7da151868a16ca445e0ec2 /packages/server/src/authentication/generateAuthenticationOptions.ts | |
parent | 6a4ced11ee7d1e872af4215f9aba82c7b64119c2 (diff) |
Figure out a better pattern for exposing iso funcs
Diffstat (limited to 'packages/server/src/authentication/generateAuthenticationOptions.ts')
-rw-r--r-- | packages/server/src/authentication/generateAuthenticationOptions.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/server/src/authentication/generateAuthenticationOptions.ts b/packages/server/src/authentication/generateAuthenticationOptions.ts index a7c3a85..3847b39 100644 --- a/packages/server/src/authentication/generateAuthenticationOptions.ts +++ b/packages/server/src/authentication/generateAuthenticationOptions.ts @@ -4,9 +4,8 @@ import type { PublicKeyCredentialDescriptorFuture, UserVerificationRequirement, } from '@simplewebauthn/typescript-types'; -import * as isoBase64URL from '../helpers/isoBase64URL' -import * as isoUint8Array from '../helpers/isoUint8Array'; +import { isoBase64URL, isoUint8Array } from '../helpers/iso' import { generateChallenge } from '../helpers/generateChallenge'; export type GenerateAuthenticationOptionsOpts = { @@ -48,14 +47,14 @@ export function generateAuthenticationOptions( */ let _challenge = challenge; if (typeof _challenge === 'string') { - _challenge = uint8Array.fromUTF8String(_challenge); + _challenge = isoUint8Array.fromUTF8String(_challenge); } return { - challenge: base64url.fromBuffer(_challenge), + challenge: isoBase64URL.fromBuffer(_challenge), allowCredentials: allowCredentials?.map(cred => ({ ...cred, - id: base64url.fromBuffer(cred.id as Uint8Array), + id: isoBase64URL.fromBuffer(cred.id as Uint8Array), })), timeout, userVerification, |