fix(clients): reject spaces, '/', '\' and control chars in client email

Client emails containing a slash broke the path-param routes
(edit/delete/view returned 404 / "client not found"), leaving stale
records that could only be cleared with manual SQLite edits. Validate
the email on both the backend (Create + Update, which also covers the
bulk paths) and the frontend (Zod) so these characters are rejected at
save time with a clear, localized message across all 13 locales.

Closes #4695
This commit is contained in:
MHSanaei
2026-05-30 22:40:48 +02:00
parent d1882c7f29
commit a0865a67fd
16 changed files with 74 additions and 1 deletions
+1
View File
@@ -646,6 +646,7 @@
"subId": "معرّف الاشتراك",
"online": "متصل",
"email": "البريد",
"emailInvalidChars": "لا يمكن أن يحتوي البريد الإلكتروني على مسافات أو '/' أو '\\' أو أحرف تحكم",
"group": "المجموعة",
"groupDesc": "تسمية منطقية لتجميع العملاء (مثل فريق، عميل، منطقة). يمكن تصفيتها من شريط الأدوات.",
"groupPlaceholder": "مثلاً customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "Subscription ID",
"online": "Online",
"email": "Email",
"emailInvalidChars": "Email cannot contain spaces, '/', '\\', or control characters",
"group": "Group",
"groupDesc": "Logical label used to bucket related clients (e.g. team, customer, region). Filterable from the toolbar.",
"groupPlaceholder": "e.g. customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "ID de suscripción",
"online": "En línea",
"email": "Email",
"emailInvalidChars": "El correo no puede contener espacios, '/', '\\' ni caracteres de control",
"group": "Grupo",
"groupDesc": "Etiqueta lógica para agrupar clientes relacionados (p. ej. equipo, cliente, región). Filtrable desde la barra de herramientas.",
"groupPlaceholder": "p. ej. customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "شناسه اشتراک",
"online": "آنلاین",
"email": "ایمیل",
"emailInvalidChars": "ایمیل نمی‌تواند شامل فاصله، '/'، '\\' یا کاراکترهای کنترلی باشد",
"group": "گروه",
"groupDesc": "برچسبی منطقی برای دسته‌بندی کاربران مرتبط (مثل تیم، مشتری، منطقه). از نوار ابزار قابل فیلتر است.",
"groupPlaceholder": "مثلاً customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "ID Langganan",
"online": "Online",
"email": "Email",
"emailInvalidChars": "Email tidak boleh mengandung spasi, '/', '\\', atau karakter kontrol",
"group": "Grup",
"groupDesc": "Label logis untuk mengelompokkan klien terkait (mis. tim, pelanggan, wilayah). Dapat difilter dari toolbar.",
"groupPlaceholder": "mis. customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "サブスクリプション ID",
"online": "オンライン",
"email": "メール",
"emailInvalidChars": "メールアドレスにスペース、'/'、'\\'、または制御文字を含めることはできません",
"group": "グループ",
"groupDesc": "関連クライアントをまとめる論理ラベル(チーム、顧客、地域など)。ツールバーからフィルタ可能。",
"groupPlaceholder": "例: customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "ID da assinatura",
"online": "Online",
"email": "Email",
"emailInvalidChars": "O e-mail não pode conter espaços, '/', '\\' ou caracteres de controle",
"group": "Grupo",
"groupDesc": "Rótulo lógico para agrupar clientes relacionados (ex.: equipe, cliente, região). Filtrável pela barra de ferramentas.",
"groupPlaceholder": "ex.: customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "ID подписки",
"online": "В сети",
"email": "Email",
"emailInvalidChars": "Email не может содержать пробелы, '/', '\\' или управляющие символы",
"group": "Группа",
"groupDesc": "Логическая метка для группировки связанных клиентов (например, команда, клиент, регион). Фильтруется из панели инструментов.",
"groupPlaceholder": "например, customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "Abonelik ID'si",
"online": "Çevrimiçi",
"email": "Email",
"emailInvalidChars": "E-posta boşluk, '/', '\\' veya kontrol karakterleri içeremez",
"group": "Grup",
"groupDesc": "İlgili istemcileri gruplamak için mantıksal etiket (ekip, müşteri, bölge). Araç çubuğundan filtrelenebilir.",
"groupPlaceholder": "örn. customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "ID підписки",
"online": "У мережі",
"email": "Email",
"emailInvalidChars": "Email не може містити пробіли, '/', '\\' або керуючі символи",
"group": "Група",
"groupDesc": "Логічна мітка для групування пов'язаних клієнтів (напр. команда, клієнт, регіон). Фільтрується з панелі інструментів.",
"groupPlaceholder": "напр. customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "ID đăng ký",
"online": "Trực tuyến",
"email": "Email",
"emailInvalidChars": "Email không được chứa khoảng trắng, '/', '\\' hoặc ký tự điều khiển",
"group": "Nhóm",
"groupDesc": "Nhãn logic để gom các client liên quan (nhóm, khách hàng, khu vực). Có thể lọc từ thanh công cụ.",
"groupPlaceholder": "ví dụ customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "订阅 ID",
"online": "在线",
"email": "邮箱",
"emailInvalidChars": "邮箱不能包含空格、'/'、'\\' 或控制字符",
"group": "分组",
"groupDesc": "用于对相关客户端进行分桶的逻辑标签(如团队、客户、地区)。可从工具栏筛选。",
"groupPlaceholder": "如 customer-a",
+1
View File
@@ -646,6 +646,7 @@
"subId": "訂閱 ID",
"online": "上線",
"email": "電子郵件",
"emailInvalidChars": "電子郵件不能包含空格、'/'、'\\' 或控制字元",
"group": "群組",
"groupDesc": "用於將相關客戶端歸類的邏輯標籤(如團隊、客戶、地區)。可從工具列篩選。",
"groupPlaceholder": "如 customer-a",