diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index f241179..1996ed1 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -15,6 +15,16 @@ const nextConfig = { // hot reload and other /_next/* dev requests from an origin it is not told // about. These are the preview's hosts, prod's and stage's. allowedDevOrigins: ["*.orun-preview.app", "preview-gateway-stage.oruncloud.workers.dev"], + experimental: { + // Dev server only: behind orun.work's live Preview the browser's Origin + // is the preview's host while `next dev` sees a local Host, and Next.js + // refuses a Server Action from an origin it is not told about. `next + // build` runs with NODE_ENV=production, so production keeps its + // same-origin check. + ...(process.env.NODE_ENV === "development" + ? { serverActions: { allowedOrigins: ["*.orun-preview.app", "preview-gateway-stage.oruncloud.workers.dev"] } } + : {}), + }, }; export default nextConfig;