logInfo => logError
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { WsService } from "@dpu/shared";
|
import { WsService } from "@dpu/shared";
|
||||||
import { logInfo } from "@dpu/shared/dist/logger.js";
|
import { logError } from "@dpu/shared/dist/logger.js";
|
||||||
import fastifyCors from "@fastify/cors";
|
import fastifyCors from "@fastify/cors";
|
||||||
import fastifySwagger from "@fastify/swagger";
|
import fastifySwagger from "@fastify/swagger";
|
||||||
import fastifySwaggerUi from "@fastify/swagger-ui";
|
import fastifySwaggerUi from "@fastify/swagger-ui";
|
||||||
@@ -117,7 +117,7 @@ async function verifyAPIKey(
|
|||||||
const apiKey = request.headers["x-api-key"];
|
const apiKey = request.headers["x-api-key"];
|
||||||
|
|
||||||
if (!apiKey || apiKey !== Config.api_key) {
|
if (!apiKey || apiKey !== Config.api_key) {
|
||||||
logInfo("POST Request with wrong API key received");
|
logError("POST Request with wrong API key received");
|
||||||
return reply.code(401).send({ error: "Invalid API key" });
|
return reply.code(401).send({ error: "Invalid API key" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user