* ci: pull version from package.json on build

* fix: implicit any type

* feat: inital support for logger

* style: fix lint

* feat: move more logging over to pino

* fix: logging around company importing
This commit is contained in:
Husky
2025-07-08 22:01:23 -04:00
committed by GitHub
parent e4fbc7cd50
commit 2b70cea4e0
33 changed files with 481 additions and 171 deletions

View File

@ -7,6 +7,7 @@ import authManager, {
checkHashArgon2,
checkHashBcrypt,
} from "~/server/internal/auth";
import { logger } from "~/server/internal/logging";
const signinValidator = type({
username: "string",
@ -28,7 +29,7 @@ export default defineEventHandler<{
const body = signinValidator(await readBody(h3));
if (body instanceof type.errors) {
// hover out.summary to see validation errors
console.error(body.summary);
logger.error(body.summary);
throw createError({
statusCode: 400,

View File

@ -1,5 +1,6 @@
import notificationSystem from "~/server/internal/notifications";
import aclManager from "~/server/internal/acls";
import { logger } from "~/server/internal/logging";
// TODO add web socket sessions for horizontal scaling
// Peer ID to user ID
@ -29,7 +30,7 @@ export default defineWebSocketHandler({
async close(peer, _details) {
const userId = socketSessions.get(peer.id);
if (!userId) {
console.log(`skipping websocket close for ${peer.id}`);
logger.info(`skipping websocket close for ${peer.id}`);
return;
}