@kidecms/core 0.36.0 → 0.37.0
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/core/auth-engine.ts +3 -3
- package/package.json +1 -1
package/core/auth-engine.ts
CHANGED
|
@@ -264,17 +264,17 @@ const DEV_SECRET = "kide-development-secret-do-not-use-in-production";
|
|
|
264
264
|
let warnedDevSecret = false;
|
|
265
265
|
|
|
266
266
|
export const resolveAuthSecret = () => {
|
|
267
|
-
const secret = safeEnv("KIDE_AUTH_SECRET")
|
|
267
|
+
const secret = safeEnv("KIDE_SECRET") || safeEnv("KIDE_AUTH_SECRET") || safeEnv("BETTER_AUTH_SECRET");
|
|
268
268
|
if (secret) return secret;
|
|
269
269
|
if (process.env.NODE_ENV === "production") {
|
|
270
270
|
throw new Error(
|
|
271
|
-
"[kide]
|
|
271
|
+
"[kide] KIDE_SECRET is not set. Generate one with `openssl rand -base64 32` and add it to the " +
|
|
272
272
|
"deployment environment — it signs admin session cookies.",
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
275
|
if (!warnedDevSecret) {
|
|
276
276
|
warnedDevSecret = true;
|
|
277
|
-
console.warn("[kide]
|
|
277
|
+
console.warn("[kide] KIDE_SECRET is not set — using a development secret.");
|
|
278
278
|
}
|
|
279
279
|
return DEV_SECRET;
|
|
280
280
|
};
|