diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index bc419f2..a51ce2f 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -4,9 +4,9 @@ import { toast } from "react-toastify"; import googleLogo from "../../../assets/images/google-logo.svg"; // import titleShape from "../../../assets/images/shape/title-shape.svg"; import titleShape from "../../../assets/images/shape/login_straight_underline.svg"; +import usersService from "../../../services/UsersService"; import InputCom from "../../Helpers/Inputs/InputCom"; import AuthLayout from "../AuthLayout"; -import usersService from "../../../services/UsersService"; export default function Login() { const [checked, setValue] = useState(false); @@ -31,15 +31,15 @@ export default function Login() { }; const navigate = useNavigate(); const userApi = new usersService(); - const doLogin = () => { + const doLogin = async () => { if (email !== "" && password !== "") { var postData = { username: email, password: password - }; - const loginResult = userApi.logInUser(postData); // just for a test - // if (email === "support@mermsemr.com") { - if (loginResult.data.status > 0 ) { // just for a start + }; + const loginResult = await userApi.logInUser(postData); // just for a test + // if (email === "support@mermsemr.com") { + if (loginResult.data.status > 0) { // just for a start localStorage.setItem("email", `${email}`); setLoginLoading(true); setTimeout(() => {