From 25dea7386ea0dd638b9504afc061fdbd55c5ddd4 Mon Sep 17 00:00:00 2001 From: jonathanbataire Date: Tue, 14 Jan 2025 11:47:56 +0300 Subject: [PATCH] clean up --- src/server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server.ts b/src/server.ts index f16025f..c19ad36 100644 --- a/src/server.ts +++ b/src/server.ts @@ -73,7 +73,8 @@ const build = (opts: FastifyServerOptions): FastifyInstance => { const chtSession = Auth.createCookieSession(cookieToken); if (!chtSession?.isAdmin && req.routeOptions.url === '/app/config') { reply.status(401).send({ error: 'unauthorized' }); - throw new Error('Unauthorized access to config. User must be admin'); + console.error('Unauthorized access to config. User must be admin'); + return; } req.chtSession = chtSession; req.sessionCache = SessionCache.getForSession(chtSession);