From 6fee2962cb8935b68863d929936ef3fd0407f9f3 Mon Sep 17 00:00:00 2001 From: balibabu Date: Thu, 25 Jul 2024 11:02:24 +0800 Subject: [PATCH] fix: Limit the length of the new password input box to no less than 8 #1634 (#1696) ### What problem does this PR solve? fix: Limit the length of the new password input box to no less than 8 #1634 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/pages/user-setting/setting-password/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/pages/user-setting/setting-password/index.tsx b/web/src/pages/user-setting/setting-password/index.tsx index f1b299ee6..cf7a4d64f 100644 --- a/web/src/pages/user-setting/setting-password/index.tsx +++ b/web/src/pages/user-setting/setting-password/index.tsx @@ -6,7 +6,6 @@ import SettingTitle from '../components/setting-title'; import { useValidateSubmittable } from '../hooks'; import { useTranslate } from '@/hooks/common-hooks'; -import parentStyles from '../index.less'; import styles from './index.less'; type FieldType = { @@ -81,13 +80,11 @@ const UserSettingPassword = () => { message: t('newPasswordMessage'), whitespace: true, }, + { type: 'string', min: 8, message: t('newPasswordDescription') }, ]} > -

- {t('newPasswordDescription')} -

@@ -100,6 +97,7 @@ const UserSettingPassword = () => { message: t('confirmPasswordMessage'), whitespace: true, }, + { type: 'string', min: 8, message: t('newPasswordDescription') }, ({ getFieldValue }) => ({ validator(_, value) { if (!value || getFieldValue('new_password') === value) {