From 1bd702c7ed2a2250375617f0d4cd5de13307e2cd Mon Sep 17 00:00:00 2001 From: 2004vivek <119566938+2004vivek@users.noreply.github.com> Date: Thu, 24 Oct 2024 18:19:03 +0530 Subject: [PATCH] Update Login.jsx Signed-off-by: 2004vivek <119566938+2004vivek@users.noreply.github.com> --- client/src/component/Login.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/component/Login.jsx b/client/src/component/Login.jsx index bef3359..def59e8 100644 --- a/client/src/component/Login.jsx +++ b/client/src/component/Login.jsx @@ -13,7 +13,7 @@ import toast from "react-hot-toast"; const VITE_SERVER_PORT = import.meta.env.VITE_SERVER_PORT || 'https://bitbox-uxbo.onrender.com'; -const Login = ({ mode, showAlert }) => { +const Login = ({ mode, showAlert,isloggedin,setloggedin }) => { const [credentials, setCredentials] = useState({ email: "", password: "" }); const [loading, setLoading] = useState(false); @@ -36,6 +36,7 @@ const Login = ({ mode, showAlert }) => { localStorage.setItem("token", json.authtoken); showAlert("Logged in Successfully", "success"); toast.success("Login Successfully!"); + setloggedin(!isloggedin) navigate("/"); } else { showAlert("Invalid Credentials", "danger");