fix(backend): Remove duplicate OPTIONS handler to resolve Startup Crash

This commit is contained in:
fullsizemalt 2026-01-08 01:52:52 -08:00
parent 8ed82cfab6
commit 7386b5c6c5

View file

@ -41,13 +41,7 @@ server.register(cors, {
});
// Manual OPTIONS handler as fallback
server.options('/*', async (request, reply) => {
reply.header('Access-Control-Allow-Origin', request.headers.origin || '*');
reply.header('Access-Control-Allow-Credentials', 'true');
reply.header('Access-Control-Allow-Methods', 'GET,POST,PUT,PATCH,DELETE,OPTIONS');
reply.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
return reply.send();
});
// Manual OPTIONS handler removed as it conflicts with @fastify/cors plugin
server.register(prismaPlugin);
server.register(jwt, {
secret: process.env.JWT_SECRET || 'supersecret'