create-prenta 1.7.3 → 1.7.4
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# create-actuate-cms
|
|
2
2
|
|
|
3
|
+
## 1.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0cc9713: reCAPTCHA v3 keys can be entered in Forms → Form Settings → Spam protection. Public forms use them, and so can the admin login once it's switched on.
|
|
8
|
+
|
|
9
|
+
**@prenta/core**
|
|
10
|
+
- `GET` / `PUT /forms/captcha-settings` (owners and admins save; the secret is encrypted with `CMS_ENCRYPTION_KEY` and never returned). `RECAPTCHA_*` / `TURNSTILE_*` env vars still win.
|
|
11
|
+
- `POST /forms/captcha-settings/login` turns admin-login protection on with the saved keys, but only after verifying a fresh `login` token from the admin's browser, so keys that don't work on the domain are refused. Changing or removing the keys turns it off. With admin-entered keys the login is let through when Google can't be reached (audited as `captcha.provider_error`); env keys keep failing closed. `CAPTCHA_LOGIN=off` disables it. reCAPTCHA logins now require the `login` action (`LOGIN_CAPTCHA_ACTION`).
|
|
12
|
+
- `GET /captcha/config` returns what the admin login checks (env keys, or admin-entered keys once login protection is on), so existing login pages never pick up form-only keys. `?for=forms` returns the captcha public forms use; Settings → Security shows that.
|
|
13
|
+
- Saved keys whose secret no longer decrypts (missing or rotated `CMS_ENCRYPTION_KEY`) keep CAPTCHA on and fail as a provider outage, so `CAPTCHA_ON_PROVIDER_ERROR` decides (forms reject by default) instead of CAPTCHA silently turning off. A failed settings read errors rather than reading as "no keys". `CaptchaConfig` gains `unavailable`.
|
|
14
|
+
- Security: the generic `/globals/:slug` and `/collections/:slug…` routes now return 404 for internal `__`-prefixed settings rows (`__email_config__`, `__ai_config__`, `__seo_config__`, `__form_captcha__`). Previously any signed-in user could read them (encrypted secrets included) and editors could create them. `GET /collections/:slug/:id/workflow` now checks collection scope and matches the collection.
|
|
15
|
+
- The admin report-only CSP keeps `'self'` in `frame-src` for preview iframes.
|
|
16
|
+
- The Form Settings CAPTCHA scope now applies: on all forms, per form (forms whose spam strategies include `captcha`), or off. The public form schema only includes `captcha` when that form requires it.
|
|
17
|
+
- reCAPTCHA verification rejects tokens for another action (forms use `form_submit`, exported as `FORM_CAPTCHA_ACTION` from `@prenta/core/forms/client`), responses with no score (v2 keys), and scores below a threshold now clamped to 0–1.
|
|
18
|
+
- The admin's report-only CSP allows Google reCAPTCHA and Cloudflare Turnstile.
|
|
19
|
+
|
|
20
|
+
**@prenta/admin**
|
|
21
|
+
- Spam protection has reCAPTCHA site key, secret key and score threshold fields, plus a "Protect the admin login" switch, and the CAPTCHA row names the active provider.
|
|
22
|
+
- The login page loads the CAPTCHA script when its config arrives after the first render. It no longer refuses to sign in when it can't get a token (script blocked, key not registered for the domain, or no answer within 8 seconds); it sends the login and the server decides.
|
|
23
|
+
|
|
24
|
+
**@prenta/sections-react**
|
|
25
|
+
- `PrentaForm` loads reCAPTCHA v3 and fetches a fresh token on each submit, so reCAPTCHA forms no longer need a `captchaToken` prop. Turnstile still does. A script that stalls is dropped after 15 seconds and loaded again on the next submit.
|
|
26
|
+
|
|
27
|
+
**create-prenta**
|
|
28
|
+
- Scaffolded login pages read `/captcha/config?for=login`, naming the login config explicitly.
|
|
29
|
+
|
|
3
30
|
## 1.7.3
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -29,7 +29,7 @@ export function generateAdminPage(options = {}) {
|
|
|
29
29
|
' async function checkAuth() {',
|
|
30
30
|
' const [setupRes, captchaRes] = await Promise.all([',
|
|
31
31
|
" cmsApi<{ setupRequired: boolean; migrationsRequired?: boolean }>('/setup/status'),",
|
|
32
|
-
" cmsApi<{ provider: string; siteKey: string | null }>('/captcha/config'),",
|
|
32
|
+
" cmsApi<{ provider: string; siteKey: string | null }>('/captcha/config?for=login'),",
|
|
33
33
|
' ]);',
|
|
34
34
|
'',
|
|
35
35
|
' if (captchaRes.data) {',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-page.ts.template.js","sourceRoot":"","sources":["../../src/templates/admin-page.ts.template.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,iBAAiB,CAAC,UAA4B,EAAE;IAC9D,OAAO;QACL,eAAe;QACf,EAAE;QACF,8CAA8C;QAC9C,oDAAoD;QACpD,qDAAqD;QACrD,iDAAiD;QACjD,4EAA4E;QAC5E,2EAA2E;QAC3E,2EAA2E;QAC3E,0EAA0E;QAC1E,kCAAkC;QAClC,qEAAqE;QACrE,GAAG,CAAC,OAAO,CAAC,gBAAgB;YAC1B,CAAC,CAAC;gBACE,+DAA+D,OAAO,CAAC,sBAAsB,IAAI,mCAAmC,IAAI;aACzI;YACH,CAAC,CAAC,EAAE,CAAC;QACP,EAAE;QACF,uCAAuC;QACvC,sDAAsD;QACtD,8DAA8D;QAC9D,iDAAiD;QACjD,wEAAwE;QACxE,6FAA6F;QAC7F,EAAE;QACF,qBAAqB;QACrB,kCAAkC;QAClC,0DAA0D;QAC1D,4FAA4F;QAC5F,
|
|
1
|
+
{"version":3,"file":"admin-page.ts.template.js","sourceRoot":"","sources":["../../src/templates/admin-page.ts.template.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,iBAAiB,CAAC,UAA4B,EAAE;IAC9D,OAAO;QACL,eAAe;QACf,EAAE;QACF,8CAA8C;QAC9C,oDAAoD;QACpD,qDAAqD;QACrD,iDAAiD;QACjD,4EAA4E;QAC5E,2EAA2E;QAC3E,2EAA2E;QAC3E,0EAA0E;QAC1E,kCAAkC;QAClC,qEAAqE;QACrE,GAAG,CAAC,OAAO,CAAC,gBAAgB;YAC1B,CAAC,CAAC;gBACE,+DAA+D,OAAO,CAAC,sBAAsB,IAAI,mCAAmC,IAAI;aACzI;YACH,CAAC,CAAC,EAAE,CAAC;QACP,EAAE;QACF,uCAAuC;QACvC,sDAAsD;QACtD,8DAA8D;QAC9D,iDA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ACxI,sKAAsK;QACtK,iFAAiF;QACjF,cAAc;QACd,QAAQ;QACR,KAAK;QACL,EAAE;QACF,sBAAsB;QACtB,cAAc;QACd,qJAAqJ;QACrJ,mKAAmK;QACnK,sHAAsH;QACtH,yFAAyF;QACzF,gBAAgB;QAChB,cAAc;QACd,QAAQ;QACR,KAAK;QACL,EAAE;QACF,qFAAqF;QACrF,+FAA+F;QAC/F,YAAY;QACZ,gBAAgB;QAChB,yBAAyB;QACzB,2BAA2B;QAC3B,8DAA8D;QAC9D,yBAAyB;QACzB,uCAAuC;QACvC,+CAA+C;QAC/C,+BAA+B;QAC/B,yCAAyC;QACzC,2CAA2C;QAC3C,uCAAuC;QACvC,wDAAwD;QACxD,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,sBAAsB,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,OAAO,CAAC,gBAAgB;YACtB,CAAC,CAAC,wFAAwF;YAC1F,CAAC,CAAC,sDAAsD;QAC1D,UAAU;QACV,MAAM;QACN,GAAG;QACH,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -23,7 +23,7 @@ export default function LoginPage() {
|
|
|
23
23
|
async function checkAuth() {
|
|
24
24
|
const [setupRes, captchaRes] = await Promise.all([
|
|
25
25
|
cmsApi<{ setupRequired: boolean; migrationsRequired?: boolean }>('/setup/status'),
|
|
26
|
-
cmsApi<{ provider: string; siteKey: string | null }>('/captcha/config'),
|
|
26
|
+
cmsApi<{ provider: string; siteKey: string | null }>('/captcha/config?for=login'),
|
|
27
27
|
]);
|
|
28
28
|
|
|
29
29
|
if (captchaRes.data) {
|