fix(backend): Remove duplicate OPTIONS handler to resolve Startup Crash
This commit is contained in:
parent
8ed82cfab6
commit
7386b5c6c5
1 changed files with 1 additions and 7 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue