@natilon/cms-server 0.5.0 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natilon/cms-server",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Express-based CMS server with pluggable adapters for content, media, auth, and build.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "bin"
36
36
  ],
37
37
  "dependencies": {
38
- "@natilon/admin-ui": "^0.5.0",
38
+ "@natilon/admin-ui": ">=0.5.0",
39
39
  "express": "^4.21.0"
40
40
  },
41
41
  "peerDependencies": {
@@ -27,9 +27,14 @@ export function createBasicAuth({
27
27
  realm = "Admin",
28
28
  }) {
29
29
  // Normalise: prefer `users` array, fall back to single user/pass pair.
30
- const userList = users?.length
30
+ // Each entry may use `pass` (plaintext) or `passEnv` (env var name).
31
+ const userList = (users?.length
31
32
  ? users
32
- : pass ? [{ user: user || "admin", pass, role: "admin" }] : [];
33
+ : pass ? [{ user: user || "admin", pass, role: "admin" }] : []
34
+ ).map((entry) => ({
35
+ ...entry,
36
+ pass: entry.passEnv ? process.env[entry.passEnv] : entry.pass,
37
+ }));
33
38
 
34
39
  const configured = userList.length > 0;
35
40