Check for existence of NEXTAUTH_URL before overwriting (#5419)

* check for existence of NEXTAUTH_URL before overwriting

* add comment
pull/5403/head
Colin Griffin 2022-11-08 10:04:18 -05:00 committed by GitHub
parent deeb8f38e5
commit cde02e1a47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,8 @@ if (!process.env.CALENDSO_ENCRYPTION_KEY) throw new Error("Please set CALENDSO_E
if (process.env.VERCEL_URL && !process.env.NEXT_PUBLIC_WEBAPP_URL) { if (process.env.VERCEL_URL && !process.env.NEXT_PUBLIC_WEBAPP_URL) {
process.env.NEXT_PUBLIC_WEBAPP_URL = "https://" + process.env.VERCEL_URL; process.env.NEXT_PUBLIC_WEBAPP_URL = "https://" + process.env.VERCEL_URL;
} }
if (process.env.NEXT_PUBLIC_WEBAPP_URL) { // Check for configuration of NEXTAUTH_URL before overriding
if (!process.env.NEXTAUTH_URL && process.env.NEXT_PUBLIC_WEBAPP_URL) {
process.env.NEXTAUTH_URL = process.env.NEXT_PUBLIC_WEBAPP_URL + "/api/auth"; process.env.NEXTAUTH_URL = process.env.NEXT_PUBLIC_WEBAPP_URL + "/api/auth";
} }
if (!process.env.NEXT_PUBLIC_WEBSITE_URL) { if (!process.env.NEXT_PUBLIC_WEBSITE_URL) {