Skip to content

Commit

Permalink
Update Login.jsx
Browse files Browse the repository at this point in the history
Signed-off-by: 2004vivek <[email protected]>
  • Loading branch information
2004vivek authored Oct 24, 2024
1 parent 5a8757b commit 1bd702c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/component/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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");
Expand Down

0 comments on commit 1bd702c

Please sign in to comment.