fix: replace unguarded crypto.randomUUID() with safe generateUUID() utility

This commit is contained in:
Linus Rath
2026-04-02 14:51:21 +02:00
parent 1bdc51dcc7
commit c4673acb65
14 changed files with 38 additions and 25 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import DOMPurify from 'dompurify';
import type { EmailTemplate } from './template-types';
import { BUILT_IN_PLACEHOLDERS } from './template-types';
import { generateUUID } from './utils';
const PLACEHOLDER_REGEX = /\{\{(\w+)\}\}/g;
const MAX_TEMPLATE_NAME_LENGTH = 200;
@@ -149,7 +150,7 @@ export function importTemplates(json: string): ImportResult {
const recipients = t.defaultRecipients as Record<string, unknown> | undefined;
templates.push({
id: crypto.randomUUID(),
id: generateUUID(),
name: sanitizeText(t.name),
subject: sanitizeText(t.subject),
body: sanitizeText(t.body),