1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00

fix: Add missing validation for password

This commit is contained in:
Maksim Eltyshev 2022-09-02 17:59:12 +05:00
parent c92612169b
commit be2642c9ce

View file

@ -8,7 +8,7 @@ import { withPopup } from '../../lib/popup';
import { Input, Popup } from '../../lib/custom-ui'; import { Input, Popup } from '../../lib/custom-ui';
import { useForm } from '../../hooks'; import { useForm } from '../../hooks';
import { isUsername } from '../../utils/validator'; import { isPassword, isUsername } from '../../utils/validator';
import styles from './UserAddPopup.module.scss'; import styles from './UserAddPopup.module.scss';
@ -69,7 +69,7 @@ const UserAddStep = React.memo(
return; return;
} }
if (!cleanData.password) { if (!cleanData.password || !isPassword(cleanData.password)) {
passwordField.current.focus(); passwordField.current.focus();
return; return;
} }
@ -149,7 +149,6 @@ const UserAddStep = React.memo(
name="password" name="password"
value={data.password} value={data.password}
readOnly={isSubmitting} readOnly={isSubmitting}
className={styles.field}
onChange={handleFieldChange} onChange={handleFieldChange}
/> />
<div className={styles.note}> <div className={styles.note}>