diff --git a/apps/web/.gitignore b/apps/web/.gitignore index 520a11d78c..3f657d09b5 100644 --- a/apps/web/.gitignore +++ b/apps/web/.gitignore @@ -68,3 +68,5 @@ public/embed # Copied app-store images public/app-store + +certificates \ No newline at end of file diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 4587fd03a0..0b5a9395bf 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -54,6 +54,20 @@ if (!process.env.NEXT_PUBLIC_API_V2_URL) { console.error("Please set NEXT_PUBLIC_API_V2_URL"); } +const getHttpsUrl = (url) => { + if (!url) return url; + if (url.startsWith("http://")) { + return url.replace("http://", "https://"); + } + return url; +}; + +if (process.argv.includes("--experimental-https")) { + process.env.NEXT_PUBLIC_WEBAPP_URL = getHttpsUrl(process.env.NEXT_PUBLIC_WEBAPP_URL); + process.env.NEXTAUTH_URL = getHttpsUrl(process.env.NEXTAUTH_URL); + process.env.NEXT_PUBLIC_EMBED_LIB_URL = getHttpsUrl(process.env.NEXT_PUBLIC_EMBED_LIB_URL); +} + const validJson = (jsonString) => { try { const o = JSON.parse(jsonString); diff --git a/apps/web/package.json b/apps/web/package.json index 93f9dee801..61e59440fb 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -8,6 +8,7 @@ "analyze:browser": "BUNDLE_ANALYZE=browser next build", "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next", "dev": "next dev", + "dev-https": "NODE_TLS_REJECT_UNAUTHORIZED=0 next dev --experimental-https", "dx": "yarn dev", "test-codegen": "yarn playwright codegen http://localhost:3000", "type-check": "tsc --pretty --noEmit", diff --git a/packages/embeds/embed-core/index.html b/packages/embeds/embed-core/index.html index 862a9886e4..2f9f7fcb08 100644 --- a/packages/embeds/embed-core/index.html +++ b/packages/embeds/embed-core/index.html @@ -389,6 +389,6 @@