Chg: loggerをclassに変更 / Feat: loggerでの発生場所の記録

This commit is contained in:
2026-03-19 20:28:45 +09:00
parent 9dc67d3016
commit 01e917c214
13 changed files with 67 additions and 27 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
import type { FastifyPluginCallback } from "fastify";
import fp from "fastify-plugin";
import { TokenEntity } from "@/modules/entities/Token";
import logger from "./logger";
import Logger from "./logger";
import { DatabaseError, ErrorBase } from "@/errors";
declare module "fastify" {
@@ -10,6 +10,8 @@ declare module "fastify" {
}
}
const logger = new Logger("Lib | auth.ts");
const Authorization: FastifyPluginCallback = (fastify) => {
fastify.addHook("onRequest", async (req, res) => {
const token = req.headers["authorization"];