grist updates
This commit is contained in:
@@ -114,7 +114,7 @@ async function verifyAPIKey(
|
||||
request: FastifyRequest,
|
||||
reply: FastifyReply,
|
||||
): Promise<void> {
|
||||
const apiKey = request.headers["x-api-key"];
|
||||
const apiKey = request.headers["x-api-key"] ?? request.headers.authorization;
|
||||
|
||||
if (!apiKey || apiKey !== Config.api_key) {
|
||||
logError("POST Request with wrong API key received");
|
||||
@@ -129,7 +129,12 @@ await fastify.register(gristRoutes, { gristService });
|
||||
await fastify.register(homeAssistantRoutes, { haService, verifyAPIKey });
|
||||
await fastify.register(tidalRoutes, { tidalService, verifyAPIKey });
|
||||
await fastify.register(wsRoutes, { wsService });
|
||||
await fastify.register(homepageRoutes, { hpService, haService, verifyAPIKey });
|
||||
await fastify.register(homepageRoutes, {
|
||||
hpService,
|
||||
gristService,
|
||||
haService,
|
||||
verifyAPIKey,
|
||||
});
|
||||
|
||||
fastify.get(
|
||||
"/ping",
|
||||
|
||||
Reference in New Issue
Block a user