summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/authentication/generateAuthenticationOptions.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-11-06 09:04:47 -0800
committerMatthew Miller <matthew@millerti.me>2022-11-06 09:04:47 -0800
commit6ca32c507f99c456c999234c546f8712f88e0ee5 (patch)
treeac101a4288ba5b657c548f3280568e53f805104c /packages/server/src/authentication/generateAuthenticationOptions.ts
parent94101488e87a56393693e617d5502c6eae096d50 (diff)
Switch to internal base64url
Diffstat (limited to 'packages/server/src/authentication/generateAuthenticationOptions.ts')
-rw-r--r--packages/server/src/authentication/generateAuthenticationOptions.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/server/src/authentication/generateAuthenticationOptions.ts b/packages/server/src/authentication/generateAuthenticationOptions.ts
index 3561b28..1eab513 100644
--- a/packages/server/src/authentication/generateAuthenticationOptions.ts
+++ b/packages/server/src/authentication/generateAuthenticationOptions.ts
@@ -4,7 +4,7 @@ import type {
PublicKeyCredentialDescriptorFuture,
UserVerificationRequirement,
} from '@simplewebauthn/typescript-types';
-import base64url from 'base64url';
+import base64url from '../helpers/base64url'
import { generateChallenge } from '../helpers/generateChallenge';
@@ -43,10 +43,10 @@ export function generateAuthenticationOptions(
} = options;
return {
- challenge: base64url.encode(challenge),
+ challenge: base64url.fromBuffer(_challenge),
allowCredentials: allowCredentials?.map(cred => ({
...cred,
- id: base64url.encode(cred.id as Buffer),
+ id: base64url.fromBuffer(cred.id as Uint8Array),
})),
timeout,
userVerification,