| @@ -2,10 +2,22 @@ | |||
| <html lang="en"> | |||
| <head> | |||
| <meta charset="utf-8" /> | |||
| <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | |||
| <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans"> | |||
| <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Poppins"> | |||
| <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Mulish"> | |||
| <link rel="icon" href="%PUBLIC_URL%/favicon.png" /> | |||
| <link | |||
| rel="stylesheet" | |||
| type="text/css" | |||
| href="https://fonts.googleapis.com/css?family=Open+Sans" | |||
| /> | |||
| <link | |||
| rel="stylesheet" | |||
| type="text/css" | |||
| href="https://fonts.googleapis.com/css?family=Poppins" | |||
| /> | |||
| <link | |||
| rel="stylesheet" | |||
| type="text/css" | |||
| href="https://fonts.googleapis.com/css?family=Mulish" | |||
| /> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |||
| <meta name="theme-color" content="#000000" /> | |||
| <meta | |||
| @@ -74,6 +74,7 @@ export default { | |||
| average: "srednja", | |||
| good: "dobra", | |||
| strong: "jaka", | |||
| strongPassword: "Lozinka mora imati barem jedan veliki karakter, jedan mali karakter i jedan znak!" | |||
| }, | |||
| register: { | |||
| title: "Registruj se", | |||
| @@ -6,7 +6,7 @@ import { | |||
| RegisterDescription, | |||
| } from "./FirstPartOfRegistration.styled"; | |||
| import { useFormik } from "formik"; | |||
| import * as Yup from "yup"; | |||
| // import * as Yup from "yup"; | |||
| import { useTranslation } from "react-i18next"; | |||
| import { TextField } from "../../../../components/TextFields/TextField/TextField"; | |||
| import { IconButton } from "../../../../components/Buttons/IconButton/IconButton"; | |||
| @@ -14,6 +14,7 @@ import { ReactComponent as VisibilityOn } from "../../../../assets/images/svg/ey | |||
| import { ReactComponent as VisibilityOff } from "../../../../assets/images/svg/eye-striked.svg"; | |||
| import { PrimaryButton } from "../../../../components/Buttons/PrimaryButton/PrimaryButton"; | |||
| import selectedTheme from "../../../../themes"; | |||
| import firstPartValidation from "../../../../validations/registerValidations/firstPartValidation"; | |||
| const FirstPartOfRegistration = (props) => { | |||
| const [showPassword, setShowPassword] = useState(false); | |||
| @@ -40,14 +41,7 @@ const FirstPartOfRegistration = (props) => { | |||
| mail: "", | |||
| password: "", | |||
| }, | |||
| validationSchema: Yup.object().shape({ | |||
| mail: Yup.string() | |||
| .email(t("forgotPassword.emailFormat")) | |||
| .required(t("login.usernameRequired")), | |||
| password: Yup.string() | |||
| .required(t("login.passwordRequired")) | |||
| .min(8, t("login.passwordLength")), | |||
| }), | |||
| validationSchema: firstPartValidation, | |||
| onSubmit: props.handleSubmit, | |||
| validateOnBlur: true, | |||
| enableReinitialize: true, | |||
| @@ -6,5 +6,9 @@ export default Yup.object().shape({ | |||
| .required(i18n.t("login.usernameRequired")), | |||
| password: Yup.string() | |||
| .required(i18n.t("login.passwordRequired")) | |||
| .min(8, i18n.t("login.passwordLength")), | |||
| .min(8, i18n.t("login.passwordLength")) | |||
| .matches( | |||
| /^(?=.*[a-z])(?=.*[A-Z])(?=.*[#$^+=!*()@%&]).{8,25}$/g, | |||
| i18n.t("password.strongPassword") | |||
| ), | |||
| }); | |||