Chg: loggerをclassに変更 / Feat: loggerでの発生場所の記録
This commit is contained in:
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user