MCP site tools, Turnstile key alert, required 2FA injection, a11y, more tests
- MCP: new get_site_info and list_pages tools (public by design, published
and indexable content only); search results collapse the homepage to root.
New listContent() helper shared with searchContent.
- Dashboard alert when Turnstile is half-configured (it is silently off then).
- twoFactor.plugin is now required; the dynamic-import fallback (which never
worked under Next and caused a Turbopack warning) is gone.
- a11y: cookie category checkboxes are labelled, buttons have type, test-email
input is labelled; tab labels keep localized collection labels.
- IPAL_IP_HEADER: one-time production warning when unset, opt-in
ipalEnvRules({ ipHeader: true }).
- Tests: SEO/robots/sitemap/hreflang, CSP, Markdown, consent, MCP, and a real
Payload + SQLite integration test for forms and the roles guard (74 total).
- Drop unused mongodb-memory-server; dev .env.example for SQLite.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { BasePayload, CollectionAfterChangeHook } from 'payload'
|
||||
import type { CollectionAfterChangeHook } from 'payload'
|
||||
|
||||
import type { I18nConfig } from '../i18n/index.js'
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export function buildPreventDeleteSystemPage(
|
||||
const assigned = settings[field]
|
||||
const assignedId =
|
||||
assigned && typeof assigned === 'object' ? (assigned as { id?: unknown }).id : assigned
|
||||
if (assignedId != null && String(assignedId) === String(id)) {
|
||||
if ((typeof assignedId === 'string' || typeof assignedId === 'number') && String(assignedId) === String(id)) {
|
||||
throw new APIError(
|
||||
`Cannot delete a page assigned to the system role "${field}". ` +
|
||||
`Detach the role in Site Settings first.`,
|
||||
|
||||
@@ -21,7 +21,7 @@ export function buildValidateUniqueRole(args: { siblingFields: string[] }): Fiel
|
||||
for (const sibling of args.siblingFields) {
|
||||
const other = (siblingData as Record<string, unknown>)?.[sibling]
|
||||
const otherId = other && typeof other === 'object' ? (other as { id?: unknown }).id : other
|
||||
if (otherId != null && String(otherId) === String(thisId)) {
|
||||
if ((typeof otherId === 'string' || typeof otherId === 'number') && String(otherId) === String(thisId)) {
|
||||
const name = typeof field === 'object' && 'name' in field ? field.name : 'ta rola'
|
||||
throw new APIError(
|
||||
`Ta sama strona jest przypisana do "${name}" i "${sibling}". ` +
|
||||
|
||||
Reference in New Issue
Block a user