diff --git a/nepalingo-web/pnpm-lock.yaml b/nepalingo-web/pnpm-lock.yaml index 20f3790..2a541b9 100644 --- a/nepalingo-web/pnpm-lock.yaml +++ b/nepalingo-web/pnpm-lock.yaml @@ -4139,6 +4139,7 @@ snapshots: v8-compile-cache-lib@3.0.1: {} +<<<<<<< HEAD vite-plugin-string@1.2.3(rollup@4.18.0)(vite@5.3.1(@types/node@20.14.9)): dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.18.0) @@ -4146,6 +4147,8 @@ snapshots: transitivePeerDependencies: - rollup +======= +>>>>>>> main vite-tsconfig-paths@4.3.2(typescript@5.5.2)(vite@5.3.1(@types/node@20.14.9)): dependencies: debug: 4.3.5 diff --git a/nepalingo-web/src/App.tsx b/nepalingo-web/src/App.tsx index 730ec68..1b4b452 100644 --- a/nepalingo-web/src/App.tsx +++ b/nepalingo-web/src/App.tsx @@ -1,4 +1,3 @@ -import React, { useState, useEffect } from "react"; import { BrowserRouter as Router, Route, @@ -7,7 +6,6 @@ import { } from "react-router-dom"; import User_auth from "./components/userAuth/UserAuth"; import Home from "./pages/Home/Home"; -import supabase from "./components/userAuth/supabaseClient"; import { useAuth } from "./components/userAuth/AuthContext"; import ReactGA from "react-ga4"; diff --git a/nepalingo-web/src/components/userAuth/UserAuth.tsx b/nepalingo-web/src/components/userAuth/UserAuth.tsx index 61d65ef..20b4b40 100644 --- a/nepalingo-web/src/components/userAuth/UserAuth.tsx +++ b/nepalingo-web/src/components/userAuth/UserAuth.tsx @@ -1,5 +1,4 @@ import React, { useState } from "react"; -import supabase from "./supabaseClient"; import { useNavigate } from "react-router-dom"; import { useAuth } from "./AuthContext"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -10,10 +9,10 @@ import { faEye, faEyeSlash, } from "@fortawesome/free-solid-svg-icons"; -//import ReactGA from "react-ga4"; +import ReactGA from "react-ga4"; const User_auth: React.FC = () => { - //ReactGA.send({ hitType: "pageview", page: "/login", title: "login" }); + ReactGA.send({ hitType: "pageview", page: "/login", title: "login" }); const [action, setAction] = useState<"Sign Up" | "Log In">("Sign Up"); const [username, setUsername] = useState(""); const [email, setEmail] = useState(""); @@ -35,28 +34,23 @@ const User_auth: React.FC = () => { } if (action === "Sign Up" && username != "") { - // Attempt to sign up the user with the provided email and password - const { error } = await supabase.auth.signUp({ + const { error } = await signUp({ email, password, options: { data: { - // Store the username in the user metadata username: username, }, }, }); if (error) { - // If there is an error during sign up, set the error message setError(error.message); } else { - // If sign up is successful, set success to true setSuccess(true); } } else { - // Attempt to log in the user with the provided email and password - const { data, error } = await supabase.auth.signInWithPassword({ + const { error } = await signIn({ email, password, }); diff --git a/nepalingo-web/src/pages/Home/Home.tsx b/nepalingo-web/src/pages/Home/Home.tsx index f838fe4..fda47c9 100644 --- a/nepalingo-web/src/pages/Home/Home.tsx +++ b/nepalingo-web/src/pages/Home/Home.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { useLocation } from "react-router-dom"; import logo from "../../assets/logo.png"; import { useAuth } from "../../components/userAuth/AuthContext"; import ReactGA from "react-ga4";