security headers, notifications, GDPR consent, masked fields

This commit is contained in:
2026-08-21 19:03:14 +02:00
parent 81fa409513
commit 05b3dc8cb1
37 changed files with 569 additions and 14 deletions
+27
View File
@@ -0,0 +1,27 @@
import { getGlobal } from '../payload/index.js';
import { NOTIFICATION_FALLBACK } from './defaults.js';
/**
* Resolves notification texts from the Notifications global, falling back to
* English defaults per field. Mirrors getConsentTexts: one read, per-field
* fallback, locale-aware. The frontend maps a submitForm result code to the
* matching text and styles it however it likes (toast, inline, banner).
*/ export async function getNotificationTexts({ locale, payload }) {
const g = await getGlobal(payload, 'notifications', {
locale
});
const f = g.form ?? {};
const fb = NOTIFICATION_FALLBACK.form;
return {
form: {
consent: f.consent || fb.consent,
error: f.error || fb.error,
notFound: f.notFound || fb.notFound,
rateLimited: f.rateLimited || fb.rateLimited,
success: f.success || fb.success,
turnstile: f.turnstile || fb.turnstile,
validation: f.validation || fb.validation
}
};
}
//# sourceMappingURL=getNotificationTexts.js.map