diff options
author | Telluu <35324579+Telluu@users.noreply.github.com> | 2023-08-04 03:28:15 +0200 |
---|---|---|
committer | Telluu <35324579+Telluu@users.noreply.github.com> | 2023-08-04 03:28:15 +0200 |
commit | 47bbe1dfd025f10033be4fd9bec2a52a4bc178f7 (patch) | |
tree | 7204d14641c52f606e7f2c2d61a27b63b19ca61f /example/index.ts | |
parent | f21955a5947f575858db0cd9ee728abc6b5f4310 (diff) |
Replace base64url with isoBase64URL
Diffstat (limited to 'example/index.ts')
-rw-r--r-- | example/index.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/example/index.ts b/example/index.ts index 9e2d9ef..ba76c17 100644 --- a/example/index.ts +++ b/example/index.ts @@ -13,7 +13,6 @@ import express from 'express'; import session from 'express-session'; import memoryStore from 'memorystore'; import dotenv from 'dotenv'; -import base64url from 'base64url'; dotenv.config(); @@ -25,7 +24,7 @@ import { generateAuthenticationOptions, verifyAuthenticationResponse, } from '@simplewebauthn/server'; -import { isoUint8Array } from '@simplewebauthn/server/helpers'; +import { isoBase64URL, isoUint8Array } from '@simplewebauthn/server/helpers'; import type { GenerateRegistrationOptionsOpts, GenerateAuthenticationOptionsOpts, @@ -247,7 +246,7 @@ app.post('/verify-authentication', async (req, res) => { const expectedChallenge = req.session.currentChallenge; let dbAuthenticator; - const bodyCredIDBuffer = base64url.toBuffer(body.rawId); + const bodyCredIDBuffer = isoBase64URL.toBuffer(body.rawId); // "Query the DB" here for an authenticator matching `credentialID` for (const dev of user.devices) { if (isoUint8Array.areEqual(dev.credentialID, bodyCredIDBuffer)) { |