{
const { t } = useTranslation()
diff --git a/web/app/install/installForm.tsx b/web/app/install/installForm.tsx
index c4f4cae626..b62f1213a0 100644
--- a/web/app/install/installForm.tsx
+++ b/web/app/install/installForm.tsx
@@ -18,8 +18,7 @@ import { fetchInitValidateStatus, fetchSetupStatus, setup } from '@/service/comm
import type { InitValidateStatusResponse, SetupStatusResponse } from '@/models/common'
import useDocumentTitle from '@/hooks/use-document-title'
import { useDocLink } from '@/context/i18n'
-
-const validPassword = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/
+import { validPassword } from '@/config'
const accountFormSchema = z.object({
email: z
diff --git a/web/app/reset-password/set-password/page.tsx b/web/app/reset-password/set-password/page.tsx
index ee4c114a77..18b7ac12fb 100644
--- a/web/app/reset-password/set-password/page.tsx
+++ b/web/app/reset-password/set-password/page.tsx
@@ -9,8 +9,7 @@ import Button from '@/app/components/base/button'
import { changePasswordWithToken } from '@/service/common'
import Toast from '@/app/components/base/toast'
import Input from '@/app/components/base/input'
-
-const validPassword = /^(?=.*[a-zA-Z])(?=.*\d).{8,}$/
+import { validPassword } from '@/config'
const ChangePasswordForm = () => {
const { t } = useTranslation()
diff --git a/web/app/signin/invite-settings/page.tsx b/web/app/signin/invite-settings/page.tsx
index 0480c2acb8..1ff1c7d671 100644
--- a/web/app/signin/invite-settings/page.tsx
+++ b/web/app/signin/invite-settings/page.tsx
@@ -16,6 +16,7 @@ import I18n from '@/context/i18n'
import { activateMember, invitationCheck } from '@/service/common'
import Loading from '@/app/components/base/loading'
import Toast from '@/app/components/base/toast'
+import { noop } from 'lodash-es'
export default function InviteSettingsPage() {
const { t } = useTranslation()
@@ -88,8 +89,7 @@ export default function InviteSettingsPage() {
{t('login.setYourAccount')}
-
diff --git a/web/config/index.spec.ts b/web/config/index.spec.ts
new file mode 100644
index 0000000000..de3ee72842
--- /dev/null
+++ b/web/config/index.spec.ts
@@ -0,0 +1,56 @@
+import { validPassword } from './index'
+
+describe('validPassword Tests', () => {
+ const passwordRegex = validPassword
+
+ // Valid passwords
+ test('Valid passwords: contains letter+digit, length ≥8', () => {
+ expect(passwordRegex.test('password1')).toBe(true)
+ expect(passwordRegex.test('PASSWORD1')).toBe(true)
+ expect(passwordRegex.test('12345678a')).toBe(true)
+ expect(passwordRegex.test('a1b2c3d4')).toBe(true)
+ expect(passwordRegex.test('VeryLongPassword123')).toBe(true)
+ expect(passwordRegex.test('short1')).toBe(false)
+ })
+
+ // Missing letter
+ test('Invalid passwords: missing letter', () => {
+ expect(passwordRegex.test('12345678')).toBe(false)
+ expect(passwordRegex.test('!@#$%^&*123')).toBe(false)
+ })
+
+ // Missing digit
+ test('Invalid passwords: missing digit', () => {
+ expect(passwordRegex.test('password')).toBe(false)
+ expect(passwordRegex.test('PASSWORD')).toBe(false)
+ expect(passwordRegex.test('AbCdEfGh')).toBe(false)
+ })
+
+ // Too short
+ test('Invalid passwords: less than 8 characters', () => {
+ expect(passwordRegex.test('pass1')).toBe(false)
+ expect(passwordRegex.test('abc123')).toBe(false)
+ expect(passwordRegex.test('1a')).toBe(false)
+ })
+
+ // Boundary test
+ test('Boundary test: exactly 8 characters', () => {
+ expect(passwordRegex.test('abc12345')).toBe(true)
+ expect(passwordRegex.test('1abcdefg')).toBe(true)
+ })
+
+ // Special characters
+ test('Special characters: non-whitespace special chars allowed', () => {
+ expect(passwordRegex.test('pass@123')).toBe(true)
+ expect(passwordRegex.test('p@$$w0rd')).toBe(true)
+ expect(passwordRegex.test('!1aBcDeF')).toBe(true)
+ })
+
+ // Contains whitespace
+ test('Invalid passwords: contains whitespace', () => {
+ expect(passwordRegex.test('pass word1')).toBe(false)
+ expect(passwordRegex.test('password1 ')).toBe(false)
+ expect(passwordRegex.test(' password1')).toBe(false)
+ expect(passwordRegex.test('pass\tword1')).toBe(false)
+ })
+})
diff --git a/web/config/index.ts b/web/config/index.ts
index af9a21e600..667723aaaf 100644
--- a/web/config/index.ts
+++ b/web/config/index.ts
@@ -276,3 +276,5 @@ export const ENABLE_WEBSITE_FIRECRAWL = getBooleanConfig(process.env.NEXT_PUBLIC
export const ENABLE_WEBSITE_WATERCRAWL = getBooleanConfig(process.env.NEXT_PUBLIC_ENABLE_WEBSITE_WATERCRAWL, DatasetAttr.DATA_PUBLIC_ENABLE_WEBSITE_WATERCRAWL, false)
export const VALUE_SELECTOR_DELIMITER = '@@@'
+
+export const validPassword = /^(?=.*[a-zA-Z])(?=.*\d)\S{8,}$/
diff --git a/web/i18n/de-DE/app-debug.ts b/web/i18n/de-DE/app-debug.ts
index 4022e755e9..1adaf6f05d 100644
--- a/web/i18n/de-DE/app-debug.ts
+++ b/web/i18n/de-DE/app-debug.ts
@@ -298,6 +298,7 @@ const translation = {
add: 'Hinzufügen',
writeOpener: 'Eröffnung schreiben',
placeholder: 'Schreiben Sie hier Ihre Eröffnungsnachricht, Sie können Variablen verwenden, versuchen Sie {{Variable}} zu tippen.',
+ openingQuestionPlaceholder: 'Sie können Variablen verwenden, versuchen Sie {{variable}} einzugeben.',
openingQuestion: 'Eröffnungsfragen',
noDataPlaceHolder:
'Den Dialog mit dem Benutzer zu beginnen, kann helfen, in konversationellen Anwendungen eine engere Verbindung mit ihnen herzustellen.',
diff --git a/web/i18n/en-US/app-debug.ts b/web/i18n/en-US/app-debug.ts
index 5282dab360..938cb27c12 100644
--- a/web/i18n/en-US/app-debug.ts
+++ b/web/i18n/en-US/app-debug.ts
@@ -446,6 +446,7 @@ const translation = {
writeOpener: 'Edit opener',
placeholder: 'Write your opener message here, you can use variables, try type {{variable}}.',
openingQuestion: 'Opening Questions',
+ openingQuestionPlaceholder: 'You can use variables, try typing {{variable}}.',
noDataPlaceHolder:
'Starting the conversation with the user can help AI establish a closer connection with them in conversational applications.',
varTip: 'You can use variables, try type {{variable}}',
diff --git a/web/i18n/es-ES/app-debug.ts b/web/i18n/es-ES/app-debug.ts
index 8c986bf669..afdea66338 100644
--- a/web/i18n/es-ES/app-debug.ts
+++ b/web/i18n/es-ES/app-debug.ts
@@ -329,6 +329,7 @@ const translation = {
writeOpener: 'Escribir apertura',
placeholder: 'Escribe tu mensaje de apertura aquí, puedes usar variables, intenta escribir {{variable}}.',
openingQuestion: 'Preguntas de Apertura',
+ openingQuestionPlaceholder: 'Puede usar variables, intente escribir {{variable}}.',
noDataPlaceHolder: 'Iniciar la conversación con el usuario puede ayudar a la IA a establecer una conexión más cercana con ellos en aplicaciones de conversación.',
varTip: 'Puedes usar variables, intenta escribir {{variable}}',
tooShort: 'Se requieren al menos 20 palabras en la indicación inicial para generar una apertura de conversación.',
diff --git a/web/i18n/fa-IR/app-debug.ts b/web/i18n/fa-IR/app-debug.ts
index 5cf9c15efe..75085ef30e 100644
--- a/web/i18n/fa-IR/app-debug.ts
+++ b/web/i18n/fa-IR/app-debug.ts
@@ -364,6 +364,7 @@ const translation = {
writeOpener: 'نوشتن آغازگر',
placeholder: 'پیام آغازگر خود را اینجا بنویسید، میتوانید از متغیرها استفاده کنید، سعی کنید {{variable}} را تایپ کنید.',
openingQuestion: 'سوالات آغازین',
+ openingQuestionPlaceholder: 'میتوانید از متغیرها استفاده کنید، سعی کنید {{variable}} را تایپ کنید.',
noDataPlaceHolder: 'شروع مکالمه با کاربر میتواند به AI کمک کند تا ارتباط نزدیکتری با آنها برقرار کند.',
varTip: 'میتوانید از متغیرها استفاده کنید، سعی کنید {{variable}} را تایپ کنید',
tooShort: 'حداقل 20 کلمه از پرسش اولیه برای تولید نظرات آغازین مکالمه مورد نیاز است.',
diff --git a/web/i18n/fr-FR/app-debug.ts b/web/i18n/fr-FR/app-debug.ts
index 6671092930..f3984c0435 100644
--- a/web/i18n/fr-FR/app-debug.ts
+++ b/web/i18n/fr-FR/app-debug.ts
@@ -317,6 +317,7 @@ const translation = {
writeOpener: 'Écrire l\'introduction',
placeholder: 'Rédigez votre message d\'ouverture ici, vous pouvez utiliser des variables, essayez de taper {{variable}}.',
openingQuestion: 'Questions d\'ouverture',
+ openingQuestionPlaceholder: 'Vous pouvez utiliser des variables, essayez de taper {{variable}}.',
noDataPlaceHolder:
'Commencer la conversation avec l\'utilisateur peut aider l\'IA à établir une connexion plus proche avec eux dans les applications conversationnelles.',
varTip: 'Vous pouvez utiliser des variables, essayez de taper {{variable}}',
diff --git a/web/i18n/hi-IN/app-debug.ts b/web/i18n/hi-IN/app-debug.ts
index 3f4b06c08b..ded2af4132 100644
--- a/web/i18n/hi-IN/app-debug.ts
+++ b/web/i18n/hi-IN/app-debug.ts
@@ -362,6 +362,7 @@ const translation = {
placeholder:
'यहां अपना प्रारंभक संदेश लिखें, आप वेरिएबल्स का उपयोग कर सकते हैं, {{variable}} टाइप करने का प्रयास करें।',
openingQuestion: 'प्रारंभिक प्रश्न',
+ openingQuestionPlaceholder: 'आप वेरिएबल्स का उपयोग कर सकते हैं, {{variable}} टाइप करके देखें।',
noDataPlaceHolder:
'उपयोगकर्ता के साथ संवाद प्रारंभ करने से एआई को संवादात्मक अनुप्रयोगों में उनके साथ निकट संबंध स्थापित करने में मदद मिल सकती है।',
varTip:
diff --git a/web/i18n/it-IT/app-debug.ts b/web/i18n/it-IT/app-debug.ts
index c8b3c08302..bfa75b282b 100644
--- a/web/i18n/it-IT/app-debug.ts
+++ b/web/i18n/it-IT/app-debug.ts
@@ -365,6 +365,7 @@ const translation = {
placeholder:
'Scrivi qui il tuo messaggio introduttivo, puoi usare variabili, prova a scrivere {{variable}}.',
openingQuestion: 'Domande iniziali',
+ openingQuestionPlaceholder: 'Puoi usare variabili, prova a digitare {{variable}}.',
noDataPlaceHolder:
'Iniziare la conversazione con l\'utente può aiutare l\'IA a stabilire un legame più stretto con loro nelle applicazioni conversazionali.',
varTip: 'Puoi usare variabili, prova a scrivere {{variable}}',
diff --git a/web/i18n/ja-JP/app-debug.ts b/web/i18n/ja-JP/app-debug.ts
index f862f3f2f7..decbe4863e 100644
--- a/web/i18n/ja-JP/app-debug.ts
+++ b/web/i18n/ja-JP/app-debug.ts
@@ -434,6 +434,7 @@ const translation = {
writeOpener: 'オープナーを書く',
placeholder: 'ここにオープナーメッセージを書いてください。変数を使用できます。{{variable}} を入力してみてください。',
openingQuestion: '開始質問',
+ openingQuestionPlaceholder: '変数を使用できます。{{variable}} と入力してみてください。',
noDataPlaceHolder:
'ユーザーとの会話を開始すると、会話アプリケーションで彼らとのより密接な関係を築くのに役立ちます。',
varTip: '変数を使用できます。{{variable}} を入力してみてください',
diff --git a/web/i18n/ko-KR/app-debug.ts b/web/i18n/ko-KR/app-debug.ts
index 3c5a3f4b1f..b84946841f 100644
--- a/web/i18n/ko-KR/app-debug.ts
+++ b/web/i18n/ko-KR/app-debug.ts
@@ -328,6 +328,7 @@ const translation = {
writeOpener: '오프너 작성',
placeholder: '여기에 오프너 메시지를 작성하세요. 변수를 사용할 수 있습니다. {{variable}}를 입력해보세요.',
openingQuestion: '시작 질문',
+ openingQuestionPlaceholder: '변수를 사용할 수 있습니다. {{variable}}을(를) 입력해 보세요.',
noDataPlaceHolder: '사용자와의 대화를 시작하면 대화 애플리케이션에서 그들과 더 밀접한 관계를 구축하는 데 도움이 됩니다.',
varTip: '변수를 사용할 수 있습니다. {{variable}}를 입력해보세요.',
tooShort: '대화 시작에는 최소 20 단어의 초기 프롬프트가 필요합니다.',
diff --git a/web/i18n/pl-PL/app-debug.ts b/web/i18n/pl-PL/app-debug.ts
index 48b44c0cbb..dcd286d351 100644
--- a/web/i18n/pl-PL/app-debug.ts
+++ b/web/i18n/pl-PL/app-debug.ts
@@ -360,6 +360,7 @@ const translation = {
placeholder:
'Tutaj napisz swoją wiadomość wprowadzającą, możesz użyć zmiennych, spróbuj wpisać {{variable}}.',
openingQuestion: 'Pytania otwierające',
+ openingQuestionPlaceholder: 'Możesz używać zmiennych, spróbuj wpisać {{variable}}.',
noDataPlaceHolder:
'Rozpoczynanie rozmowy z użytkownikiem może pomóc AI nawiązać bliższe połączenie z nim w aplikacjach konwersacyjnych.',
varTip: 'Możesz używać zmiennych, spróbuj wpisać {{variable}}',
diff --git a/web/i18n/pt-BR/app-debug.ts b/web/i18n/pt-BR/app-debug.ts
index 64f7a85fe7..96d78dc9a3 100644
--- a/web/i18n/pt-BR/app-debug.ts
+++ b/web/i18n/pt-BR/app-debug.ts
@@ -334,6 +334,7 @@ const translation = {
writeOpener: 'Escrever abertura',
placeholder: 'Escreva sua mensagem de abertura aqui, você pode usar variáveis, tente digitar {{variável}}.',
openingQuestion: 'Perguntas de Abertura',
+ openingQuestionPlaceholder: 'Você pode usar variáveis, tente digitar {{variable}}.',
noDataPlaceHolder:
'Iniciar a conversa com o usuário pode ajudar a IA a estabelecer uma conexão mais próxima com eles em aplicativos de conversação.',
varTip: 'Você pode usar variáveis, tente digitar {{variável}}',
diff --git a/web/i18n/ru-RU/app-debug.ts b/web/i18n/ru-RU/app-debug.ts
index 00cd6e8a75..5d4dbb53d3 100644
--- a/web/i18n/ru-RU/app-debug.ts
+++ b/web/i18n/ru-RU/app-debug.ts
@@ -370,6 +370,7 @@ const translation = {
writeOpener: 'Написать начальное сообщение',
placeholder: 'Напишите здесь свое начальное сообщение, вы можете использовать переменные, попробуйте ввести {{variable}}.',
openingQuestion: 'Начальные вопросы',
+ openingQuestionPlaceholder: 'Вы можете использовать переменные, попробуйте ввести {{variable}}.',
noDataPlaceHolder:
'Начало разговора с пользователем может помочь ИИ установить более тесную связь с ним в диалоговых приложениях.',
varTip: 'Вы можете использовать переменные, попробуйте ввести {{variable}}',
diff --git a/web/i18n/tr-TR/app-debug.ts b/web/i18n/tr-TR/app-debug.ts
index f08d221d45..6ed0e0a5eb 100644
--- a/web/i18n/tr-TR/app-debug.ts
+++ b/web/i18n/tr-TR/app-debug.ts
@@ -368,6 +368,7 @@ const translation = {
writeOpener: 'Başlangıç mesajı yaz',
placeholder: 'Başlangıç mesajınızı buraya yazın, değişkenler kullanabilirsiniz, örneğin {{variable}} yazmayı deneyin.',
openingQuestion: 'Açılış Soruları',
+ openingQuestionPlaceholder: 'Değişkenler kullanabilirsiniz, {{variable}} yazmayı deneyin.',
noDataPlaceHolder:
'Kullanıcı ile konuşmayı başlatmak, AI\'ın konuşma uygulamalarında onlarla daha yakın bir bağlantı kurmasına yardımcı olabilir.',
varTip: 'Değişkenler kullanabilirsiniz, örneğin {{variable}} yazmayı deneyin',
diff --git a/web/i18n/uk-UA/app-debug.ts b/web/i18n/uk-UA/app-debug.ts
index 7e410ffef9..70bbebe37e 100644
--- a/web/i18n/uk-UA/app-debug.ts
+++ b/web/i18n/uk-UA/app-debug.ts
@@ -328,6 +328,7 @@ const translation = {
writeOpener: 'Напишіть вступне повідомлення', // Write opener
placeholder: 'Напишіть тут своє вступне повідомлення, ви можете використовувати змінні, спробуйте ввести {{variable}}.', // Write your opener message here...
openingQuestion: 'Відкриваючі питання', // Opening Questions
+ openingQuestionPlaceholder: 'Ви можете використовувати змінні, спробуйте ввести {{variable}}.',
noDataPlaceHolder: 'Початок розмови з користувачем може допомогти ШІ встановити більш тісний зв’язок з ним у розмовних застосунках.', // ... conversational applications.
varTip: 'Ви можете використовувати змінні, спробуйте ввести {{variable}}', // You can use variables, try type {{variable}}
tooShort: 'Для створення вступних зауважень для розмови потрібно принаймні 20 слів вступного запиту.', // ... are required to generate an opening remarks for the conversation.
diff --git a/web/i18n/vi-VN/app-debug.ts b/web/i18n/vi-VN/app-debug.ts
index c091cb5abb..cd57f78e79 100644
--- a/web/i18n/vi-VN/app-debug.ts
+++ b/web/i18n/vi-VN/app-debug.ts
@@ -328,6 +328,7 @@ const translation = {
writeOpener: 'Viết câu mở đầu',
placeholder: 'Viết thông điệp mở đầu của bạn ở đây, bạn có thể sử dụng biến, hãy thử nhập {{biến}}.',
openingQuestion: 'Câu hỏi mở đầu',
+ openingQuestionPlaceholder: 'Bạn có thể sử dụng biến, hãy thử nhập {{variable}}.',
noDataPlaceHolder: 'Bắt đầu cuộc trò chuyện với người dùng có thể giúp AI thiết lập mối quan hệ gần gũi hơn với họ trong các ứng dụng trò chuyện.',
varTip: 'Bạn có thể sử dụng biến, hãy thử nhập {{biến}}',
tooShort: 'Cần ít nhất 20 từ trong lời nhắc ban đầu để tạo ra các câu mở đầu cho cuộc trò chuyện.',
diff --git a/web/i18n/zh-Hans/app-debug.ts b/web/i18n/zh-Hans/app-debug.ts
index 4f84b396d0..3728d86e58 100644
--- a/web/i18n/zh-Hans/app-debug.ts
+++ b/web/i18n/zh-Hans/app-debug.ts
@@ -436,6 +436,7 @@ const translation = {
writeOpener: '编写开场白',
placeholder: '在这里写下你的开场白,你可以使用变量,尝试输入 {{variable}}。',
openingQuestion: '开场问题',
+ openingQuestionPlaceholder: '可以使用变量,尝试输入 {{variable}}。',
noDataPlaceHolder:
'在对话型应用中,让 AI 主动说第一段话可以拉近与用户间的距离。',
varTip: '你可以使用变量,试试输入 {{variable}}',
diff --git a/web/i18n/zh-Hant/app-debug.ts b/web/i18n/zh-Hant/app-debug.ts
index 16374992b5..b31b9a9d66 100644
--- a/web/i18n/zh-Hant/app-debug.ts
+++ b/web/i18n/zh-Hant/app-debug.ts
@@ -313,6 +313,7 @@ const translation = {
writeOpener: '編寫開場白',
placeholder: '在這裡寫下你的開場白,你可以使用變數,嘗試輸入 {{variable}}。',
openingQuestion: '開場問題',
+ openingQuestionPlaceholder: '可以使用變量,嘗試輸入 {{variable}}。',
noDataPlaceHolder:
'在對話型應用中,讓 AI 主動說第一段話可以拉近與使用者間的距離。',
varTip: '你可以使用變數,試試輸入 {{variable}}',