regex
This commit is contained in:
@@ -28,10 +28,7 @@ const CreatePassword = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [, setTooltip] = useGlobal("_tooltip");
|
||||
|
||||
const passwordRegex = useMemo(
|
||||
() => /^(?=.*[a-z])(?=.*[A-Z])(?=.*[^A-Za-z0-9]).{8,}$/,
|
||||
[]
|
||||
);
|
||||
const passwordRegex = useMemo(() => /^.{6,}$/, []);
|
||||
|
||||
const handlePasswordChange = (text) => {
|
||||
setPassword(text);
|
||||
@@ -42,7 +39,7 @@ const CreatePassword = () => {
|
||||
|
||||
if (!passwordRegex.test(text)) {
|
||||
setPasswordError(
|
||||
"Ton mot de passe doit contenir 8 caractères, une majuscule, une minuscule et un caractère spécial."
|
||||
"Ton mot de passe doit contenir au moins 6 caractères."
|
||||
);
|
||||
} else {
|
||||
setPasswordError("");
|
||||
@@ -55,7 +52,7 @@ const CreatePassword = () => {
|
||||
try {
|
||||
if (!isPasswordValid) {
|
||||
setTooltip({
|
||||
text: "Ton mot de passe doit contenir 8 caractères, une majuscule, une minuscule et un caractère spécial.",
|
||||
text: "Ton mot de passe doit contenir au moins 6 caractères.",
|
||||
type: "error",
|
||||
});
|
||||
return;
|
||||
@@ -128,7 +125,7 @@ const CreatePassword = () => {
|
||||
fontFamily: FONT_FAMILY.InterRegular,
|
||||
}}
|
||||
>
|
||||
Utilise au moins 8 caractères pour sécuriser ton compte.
|
||||
Utilise au moins 6 caractères pour sécuriser ton compte.
|
||||
</Text>
|
||||
</View>
|
||||
<Input
|
||||
|
||||
Reference in New Issue
Block a user