From ce491df30dfb987c05186597d84ae098b2ab5ca4 Mon Sep 17 00:00:00 2001
From: Chalsi Jain <100270122+Chelsea67jain@users.noreply.github.com>
Date: Sat, 10 Aug 2024 18:14:10 +0530
Subject: [PATCH 1/7] Updated main.jsx
---
Frontend/src/main.jsx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Frontend/src/main.jsx b/Frontend/src/main.jsx
index 9f7f4a9..08d6ad8 100644
--- a/Frontend/src/main.jsx
+++ b/Frontend/src/main.jsx
@@ -7,11 +7,13 @@ import FeedbackButton from "./Components/Feedbtn";
ReactDOM.createRoot(document.getElementById("root")).render(
+
+
);
From 690aaf5a8ceae176943693561a35e360a94be5a9 Mon Sep 17 00:00:00 2001
From: Chalsi Jain <100270122+Chelsea67jain@users.noreply.github.com>
Date: Sat, 10 Aug 2024 18:18:12 +0530
Subject: [PATCH 2/7] Updated Profile.jsx
---
Frontend/src/Pages/Profile.jsx | 35 ++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/Frontend/src/Pages/Profile.jsx b/Frontend/src/Pages/Profile.jsx
index 562ea03..ac2557f 100644
--- a/Frontend/src/Pages/Profile.jsx
+++ b/Frontend/src/Pages/Profile.jsx
@@ -7,13 +7,15 @@ import RemoveRedEyeIcon from "@mui/icons-material/RemoveRedEye";
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff"
import { FormLoader } from "../Components/Loader";
import convertToBase64 from "./convertToBase64";
+import {GoogleOAuthProvider, GoogleLogin } from "@react-oauth/google";
+import {jwtDecode} from "jwt-decode";
// components
import toast from 'react-hot-toast';
import Error from "../Components/Error";
import UserProfile from "./UserProfile";
import { useCart } from "../Components/CartContext";
-import ".././CSS/Profile.css";
+import "../CSS/Profile.css";
import Reg from "/reg.png";
const Profile = () => {
@@ -34,7 +36,18 @@ const Profile = () => {
const backendUrl = "https://ecommerce-backend-0wr7.onrender.com/";
const [file, setFile] = useState(null);
+
+const responseMessage = (credentialResponse) => {
+ const credentialDecoded = jwtDecode(credentialResponse.credential);
+ console.log("Google Login Success:", credentialDecoded);
+navigate("/home");
+ };
+ const errorMessage = (error) => {
+
+ console.log(error);
+ console.log("Failed to login");
+ };
useEffect(() => {
const token = localStorage.getItem("token");
const userData = localStorage.getItem("userData");
@@ -207,7 +220,12 @@ const Profile = () => {
{isLogin ? "Login" : "Sign Up"}
+
{isLogin ? (
+
From 70b0cfb1579d13a2dc08bedd7406dcf7d3c9c151 Mon Sep 17 00:00:00 2001
From: Chalsi Jain <100270122+Chelsea67jain@users.noreply.github.com>
Date: Sat, 10 Aug 2024 18:22:04 +0530
Subject: [PATCH 3/7] Added script inside index.html
---
Frontend/index.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Frontend/index.html b/Frontend/index.html
index 16afac1..42b9240 100644
--- a/Frontend/index.html
+++ b/Frontend/index.html
@@ -17,6 +17,7 @@
+