From 5134925c9b0be99fcdd85f9e9aca11855107ed6a Mon Sep 17 00:00:00 2001 From: Michael Avoyan Date: Sun, 30 Jun 2024 17:25:27 +0300 Subject: [PATCH] fix --- .../src/controllers/getPresentationRequest.ts | 2 +- packages/sample-server/src/plugins/vclSdkPlugin.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/sample-server/src/controllers/getPresentationRequest.ts b/packages/sample-server/src/controllers/getPresentationRequest.ts index ab62919..629bc71 100644 --- a/packages/sample-server/src/controllers/getPresentationRequest.ts +++ b/packages/sample-server/src/controllers/getPresentationRequest.ts @@ -9,7 +9,7 @@ import { FastifyReply, FastifyRequest } from "fastify"; export async function getPresentationRequest( req: FastifyRequest, reply: FastifyReply, -){ +) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const deepLink = req.body diff --git a/packages/sample-server/src/plugins/vclSdkPlugin.ts b/packages/sample-server/src/plugins/vclSdkPlugin.ts index 101ec93..ab8eb95 100644 --- a/packages/sample-server/src/plugins/vclSdkPlugin.ts +++ b/packages/sample-server/src/plugins/vclSdkPlugin.ts @@ -41,12 +41,12 @@ const vclSdkPlugin: FastifyPluginAsync | FastifyPluginCallback = async ( console.error('Failed to initialize VCL SDK', e); throw e; } - fastify - .decorate('vclSdk', vclSdk) - .decorateRequest('vclSdk', null) - .addHook('preValidation', async (req) => { - req.vclSdk = fastify.vclSdk; - }); + fastify.decorate('vclSdk', vclSdk) + fastify.addHook('preHandler', function (req, reply, done) { + req.vclSdk = vclSdk + reply.vclSdk = vclSdk + done() + }) }; export default vclSdkPlugin;