From dc2ef0dec07af36224f076d1dbb84cbccf5ca021 Mon Sep 17 00:00:00 2001 From: Akhil Meka Date: Tue, 25 Feb 2025 14:18:33 +0530 Subject: [PATCH] webauthn bug fix --- src/file/file.route.ts | 4 ++++ src/webauthn/webauthn.route.ts | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/file/file.route.ts b/src/file/file.route.ts index 415a14f..b7dcd90 100644 --- a/src/file/file.route.ts +++ b/src/file/file.route.ts @@ -29,6 +29,10 @@ export async function fileRoutes(fastify: FastifyInstance) { { schema: { params: { type: "object", properties: { fileId: { type: "string" } } }, + querystring: { + type: "object", + properties: { direct: { type: "boolean" } }, + }, response: { 200: $file("downloadFileResponse"), }, diff --git a/src/webauthn/webauthn.route.ts b/src/webauthn/webauthn.route.ts index e73e01c..cb92435 100644 --- a/src/webauthn/webauthn.route.ts +++ b/src/webauthn/webauthn.route.ts @@ -235,8 +235,16 @@ export async function webAuthnRoutes(fastify: FastifyInstance) { expectedChallenge: userInDB.challenge.value as string, expectedRPID: rpID, expectedOrigin: origin, - // @ts-ignore - credential: credential, + credential: { + // @ts-ignore + id: credential.credentialID, + // @ts-ignore + publicKey: credential.credentialPublicKey.buffer, + // @ts-ignore + counter: credential.counter, + // @ts-ignore + transports: credential.transports, + }, }); if (!verification.verified)