From bbe29b7fa3eb46b5234748d35131192c746e6770 Mon Sep 17 00:00:00 2001 From: ChineseChikki Date: Fri, 27 Jan 2023 18:34:55 +0100 Subject: [PATCH] login implemented --- src/components/AuthPages/Login/index.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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(() => { -- 2.34.1