Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbataire committed Jan 14, 2025
1 parent 7816ae2 commit 25dea73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 25dea73

Please sign in to comment.