balibabu commited on
Commit
9d25ba5
·
1 Parent(s): 6ead7eb

fix: Limit the length of the new password input box to no less than 8 #1634 (#1696)

Browse files

### 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 CHANGED
@@ -6,7 +6,6 @@ import SettingTitle from '../components/setting-title';
6
  import { useValidateSubmittable } from '../hooks';
7
 
8
  import { useTranslate } from '@/hooks/common-hooks';
9
- import parentStyles from '../index.less';
10
  import styles from './index.less';
11
 
12
  type FieldType = {
@@ -81,13 +80,11 @@ const UserSettingPassword = () => {
81
  message: t('newPasswordMessage'),
82
  whitespace: true,
83
  },
 
84
  ]}
85
  >
86
  <Input.Password />
87
  </Form.Item>
88
- <p className={parentStyles.itemDescription}>
89
- {t('newPasswordDescription')}
90
- </p>
91
  </Form.Item>
92
  <Divider />
93
  <Form.Item<FieldType>
@@ -100,6 +97,7 @@ const UserSettingPassword = () => {
100
  message: t('confirmPasswordMessage'),
101
  whitespace: true,
102
  },
 
103
  ({ getFieldValue }) => ({
104
  validator(_, value) {
105
  if (!value || getFieldValue('new_password') === value) {
 
6
  import { useValidateSubmittable } from '../hooks';
7
 
8
  import { useTranslate } from '@/hooks/common-hooks';
 
9
  import styles from './index.less';
10
 
11
  type FieldType = {
 
80
  message: t('newPasswordMessage'),
81
  whitespace: true,
82
  },
83
+ { type: 'string', min: 8, message: t('newPasswordDescription') },
84
  ]}
85
  >
86
  <Input.Password />
87
  </Form.Item>
 
 
 
88
  </Form.Item>
89
  <Divider />
90
  <Form.Item<FieldType>
 
97
  message: t('confirmPasswordMessage'),
98
  whitespace: true,
99
  },
100
+ { type: 'string', min: 8, message: t('newPasswordDescription') },
101
  ({ getFieldValue }) => ({
102
  validator(_, value) {
103
  if (!value || getFieldValue('new_password') === value) {