From 4db4020859c427f58b82e5650b4e4ac9aa06811f Mon Sep 17 00:00:00 2001 From: webbrain-one <295484252+webbrain-one@users.noreply.github.com> Date: Tue, 4 Aug 2026 14:24:54 +0300 Subject: [PATCH] fix: resolve CORS error during signup Update next.config.ts to handle cross-origin requests, fixing the CORS error encountered on the deployed signup flow. Closes #2 --- next.config.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/next.config.ts b/next.config.ts index b88b134..9ced97d 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,19 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - + async headers() { + return [ + { + source: "/api/:path*", + headers: [ + { key: "Access-Control-Allow-Credentials", value: "true" }, + { key: "Access-Control-Allow-Origin", value: "*" }, + { key: "Access-Control-Allow-Methods", value: "GET,DELETE,PATCH,POST,PUT" }, + { key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }, + ] + } + ] + } }; export default nextConfig;