Commit efb8755b by asranov0003

feat: validate auth password inputs min lenght

parent 7dd94ee5
......@@ -203,7 +203,8 @@
},
"error": {
"requiredField": "This field is required",
"requiredCheckbox": "You must accept this"
"requiredCheckbox": "You must accept this",
"passwordMinLength": "Password must be at least 6 characters"
},
"weekdays": {
"monday": "Monday",
......
......@@ -203,7 +203,8 @@
},
"error": {
"requiredField": "Это поле обязательное",
"requiredCheckbox": "Вы должны принять это"
"requiredCheckbox": "Вы должны принять это",
"passwordMinLength": "Пароль должен содержать минимум 6 символов"
},
"weekdays": {
"monday": "Понедельник",
......
......@@ -203,7 +203,8 @@
},
"error": {
"requiredField": "Bu maydonni to'ldirish zarur",
"requiredCheckbox": "Siz bu ro'yxatni qabul qilishingiz kerak"
"requiredCheckbox": "Siz bu ro'yxatni qabul qilishingiz kerak",
"passwordMinLength": "Parol kamida 6 ta belgidan iborat bo'lishi kerak"
},
"weekdays": {
"monday": "Dushanba",
......
......@@ -71,7 +71,13 @@ const Login: React.FC = () => {
label={`${t("auth.password")}`}
placeholder={`${t("auth.passwordPlaceholder")}`}
type="password"
{...register("password", { required: t("error.requiredField") })}
{...register("password", {
required: t("error.requiredField"),
minLength: {
value: 6,
message: t("error.passwordMinLength"),
},
})}
error={errors.password?.message as string}
/>
......
......@@ -63,7 +63,13 @@ const Recover: React.FC = () => {
label={`${t("auth.newPassword")}`}
placeholder={`${t("auth.newPasswordPlaceholder")}`}
type="password"
{...register("newPassword", { required: t("error.requiredField") })}
{...register("newPassword", {
required: t("error.requiredField"),
minLength: {
value: 6,
message: t("error.passwordMinLength"),
},
})}
error={errors.newPassword?.message as string}
/>
......
......@@ -73,7 +73,13 @@ const Register: React.FC = () => {
label={`${t("auth.newPassword")}`}
placeholder={`${t("auth.newPasswordPlaceholder")}`}
type="password"
{...register("password", { required: t("error.requiredField") })}
{...register("password", {
required: t("error.requiredField"),
minLength: {
value: 6,
message: t("error.passwordMinLength"),
},
})}
error={errors.password?.message as string}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment