feat: allow any origin with CORS in favour of our manual validation

This commit is contained in:
2025-02-17 03:00:48 -08:00
parent 23e0bcc0b8
commit fc213289c2
3 changed files with 34 additions and 0 deletions
+1
View File
@@ -24,6 +24,7 @@
"typescript": "5.7.3"
},
"dependencies": {
"@fastify/cors": "10.0.2",
"@nhcarrigan/logger": "1.0.0",
"@prisma/client": "6.3.1",
"fastify": "5.2.1",
+5
View File
@@ -4,6 +4,7 @@
* @author Naomi Carrigan
*/
import cors from "@fastify/cors";
import { PrismaClient } from "@prisma/client";
import fastify from "fastify";
import { authHook } from "./hooks/auth.js";
@@ -25,6 +26,10 @@ try {
logger: false,
});
server.register(cors, {
origin: "*",
});
server.addHook("preHandler", authHook);
server.addHook("preHandler", corsHook);