@netlify/plugin-nextjs 4.23.0 → 4.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +9 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -71,10 +71,17 @@ const plugin = {
|
|
|
71
71
|
const config = await (0, config_1.getRequiredServerFiles)(publish);
|
|
72
72
|
const userDefinedNextAuthUrl = config.config.env.NEXTAUTH_URL;
|
|
73
73
|
if (userDefinedNextAuthUrl) {
|
|
74
|
-
console.log(`NextAuth package detected, NEXTAUTH_URL environment variable set by user to ${userDefinedNextAuthUrl}`);
|
|
74
|
+
console.log(`NextAuth package detected, NEXTAUTH_URL environment variable set by user in next.config.js to ${userDefinedNextAuthUrl}`);
|
|
75
|
+
}
|
|
76
|
+
else if (process.env.NEXTAUTH_URL) {
|
|
77
|
+
// When the value is specified in the netlify.toml or the Netlify UI (will be evaluated in this order)
|
|
78
|
+
const nextAuthUrl = `${process.env.NEXTAUTH_URL}${basePath}`;
|
|
79
|
+
console.log(`NextAuth package detected, NEXTAUTH_URL environment variable set by user in Netlify configuration to ${nextAuthUrl}`);
|
|
80
|
+
config.config.env.NEXTAUTH_URL = nextAuthUrl;
|
|
81
|
+
await (0, config_1.updateRequiredServerFiles)(publish, config);
|
|
75
82
|
}
|
|
76
83
|
else {
|
|
77
|
-
const nextAuthUrl = `${process.env.
|
|
84
|
+
const nextAuthUrl = `${process.env.DEPLOY_PRIME_URL}${basePath}`;
|
|
78
85
|
console.log(`NextAuth package detected, setting NEXTAUTH_URL environment variable to ${nextAuthUrl}`);
|
|
79
86
|
config.config.env.NEXTAUTH_URL = nextAuthUrl;
|
|
80
87
|
await (0, config_1.updateRequiredServerFiles)(publish, config);
|