From 34c1041182569f416b0710cd5a935a24660a3cf3 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Thu, 11 Jan 2024 23:10:51 +0000 Subject: [PATCH] Hard coded the CORS for the EnCoach website --- next.config.js | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/next.config.js b/next.config.js index 6eefe6ab..4a6bb16f 100644 --- a/next.config.js +++ b/next.config.js @@ -1,27 +1,26 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - reactStrictMode: true, - output: "standalone", - async headers() { - return [ - { - source: "/api/packages", - headers: [ - { key: "Access-Control-Allow-Credentials", value: "false" }, - { key: "Access-Control-Allow-Origin", value: process.env.WEBSITE_URL }, - { - key: "Access-Control-Allow-Methods", - value: "GET", - }, - { - key: "Access-Control-Allow-Headers", - value: - "Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date", - }, - ], - }, - ]; - }, + reactStrictMode: true, + output: "standalone", + async headers() { + return [ + { + source: "/api/packages", + headers: [ + {key: "Access-Control-Allow-Credentials", value: "false"}, + {key: "Access-Control-Allow-Origin", value: "https://encoach.com"}, + { + key: "Access-Control-Allow-Methods", + value: "GET", + }, + { + key: "Access-Control-Allow-Headers", + value: "Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date", + }, + ], + }, + ]; + }, }; module.exports = nextConfig;