feat: improve handling of deployment env vars
These are now defined in Netlify UI for dedicated environments (test, stage, production): AUTH_URL NEXTAUTH_URL PUBLIC_URL Code now falls back to incoming request host. Mainly used for deployment previews which do not have Akamai in front, meaning we do not need the above workaround as incoming request host matches the actual public facing host. When Akamai is in front, we lose the public facing host in Netlify's routing layer as they internally use `x-forwarded-for` and we can't claim it for our usage.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"prebuild": "npm run update-dotenv && npm run lint && npm run test:unit",
|
||||
"prebuild": "npm run lint && npm run test:unit",
|
||||
"build": "next build",
|
||||
"predev": "rm -rf .next",
|
||||
"dev": "PORT=3000 NEXT_PUBLIC_PORT=3000 next dev",
|
||||
@@ -20,7 +20,6 @@
|
||||
"test:e2e:headless": "start-server-and-test test:setup http://127.0.0.1:3000/en/sponsoring \"cypress run --e2e\"",
|
||||
"test:setup": "npm run build && npm run start",
|
||||
"preinstall": "export $(cat .env.local | grep -v '^#' | xargs)",
|
||||
"update-dotenv": "node update-dotenv.mjs",
|
||||
"test:unit": "jest",
|
||||
"test:unit:watch": "jest --watch"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user