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:
Michael Zetterberg
2024-10-14 20:43:53 +02:00
parent 3a3491c534
commit 4a846540c3
26 changed files with 72 additions and 485 deletions

4
.env
View File

@@ -1,4 +0,0 @@
# See update-dotenv.mjs
AUTH_URL="REPLACE-ON-NETLIFY-BUILD"
NEXTAUTH_URL="REPLACE-ON-NETLIFY-BUILD"
PUBLIC_URL="REPLACED-ON-NETLIFY-BUILD"