From 4448b86b93309a855f7a91e2347cb3b79c9cec40 Mon Sep 17 00:00:00 2001 From: The Mark Date: Sun, 23 Oct 2022 13:31:24 -0400 Subject: [PATCH] fix: Accept logged and not logged user in /base --- apps/api/src/routes/api/v1/base/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/api/src/routes/api/v1/base/index.ts b/apps/api/src/routes/api/v1/base/index.ts index 76854af8a..622a5aa4f 100644 --- a/apps/api/src/routes/api/v1/base/index.ts +++ b/apps/api/src/routes/api/v1/base/index.ts @@ -2,6 +2,14 @@ import { FastifyPluginAsync } from 'fastify'; import { errorHandler, listSettings, version } from '../../../../lib/common'; const root: FastifyPluginAsync = async (fastify): Promise => { + fastify.addHook('onRequest', async (request) => { + try { + return await request.jwtVerify(); + } catch(error){ + return {}; + } + }) + fastify.get('/', async (request) => { const teamId = request.user?.teamId; const settings = await listSettings()