+
+
+ {" "}
+ Welcome {username}
+
+
+
+
+
+ );
+};
+
+export default HomePage;
diff --git a/client/src/pages/Login.js b/client/src/pages/Login.js
new file mode 100644
index 0000000..3a99811
--- /dev/null
+++ b/client/src/pages/Login.js
@@ -0,0 +1,95 @@
+import React, { useState } from "react";
+import { Link, useNavigate } from "react-router-dom";
+import axios from "axios";
+import { ToastContainer, toast } from "react-toastify";
+
+const Loginup = () => {
+ const navigate = useNavigate();
+ const [inputValue, setInputValue] = useState({
+ email: "",
+ password: "",
+ });
+ const { email, password } = inputValue;
+ const handleOnChange = (e) => {
+ const { name, value } = e.target;
+ setInputValue({
+ ...inputValue,
+ [name]: value,
+ });
+ };
+
+ const handleError = (err) =>
+ toast.error(err, {
+ position: "bottom-left",
+ });
+ const handleSuccess = (msg) =>
+ toast.success(msg, {
+ position: "bottom-left",
+ });
+
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+ try {
+ const { data } = await axios.post(
+ "http://localhost:4000/login",
+ {
+ ...inputValue,
+ },
+ { withCredentials: true }
+ );
+ console.log(data);
+ const { success, message } = data;
+ if (success) {
+ handleSuccess(message);
+ setTimeout(() => {
+ navigate("/");
+ }, 1000);
+ } else {
+ handleError(message);
+ }
+ } catch (error) {
+ console.log(error);
+ }
+ setInputValue({
+ ...inputValue,
+ email: "",
+ password: "",
+ });
+ };
+ return (
+