{currentUser ? (
diff --git a/client/src/components/OAuth.jsx b/client/src/components/OAuth.jsx
index ba2db33..815bc9e 100644
--- a/client/src/components/OAuth.jsx
+++ b/client/src/components/OAuth.jsx
@@ -13,6 +13,7 @@ export default function OAuth() {
const auth = getAuth(app);
const result = await signInWithPopup(auth, provider);
+ console.log(result);
const res = await fetch('/api/auth/google', {
method: 'POST',
headers: {
@@ -28,7 +29,8 @@ export default function OAuth() {
console.log(data);
dispatch(signInSuccess(data));
navigate('/');
- } catch (error) {
+ }
+ catch (error) {
console.log('could not login with google', error);
}
};
diff --git a/client/src/firebase.js b/client/src/firebase.js
index a6a6c41..e76f4b8 100644
--- a/client/src/firebase.js
+++ b/client/src/firebase.js
@@ -1,17 +1,21 @@
// Import the functions you need from the SDKs you need
-import { initializeApp } from 'firebase/app';
+import { initializeApp } from "firebase/app";
+import { getAnalytics } from "firebase/analytics";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
+// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
- apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
- authDomain: 'mern-auth-1c4ae.firebaseapp.com',
- projectId: 'mern-auth-1c4ae',
- storageBucket: 'mern-auth-1c4ae.appspot.com',
- messagingSenderId: '277641423672',
- appId: '1:277641423672:web:2de25252aae022d51aafcd',
+ apiKey: "AIzaSyC7PSE_5e2MUYSkUAXeY1o7kLKfX1oazac",
+ authDomain: "mern-auth-75877.firebaseapp.com",
+ projectId: "mern-auth-75877",
+ storageBucket: "mern-auth-75877.appspot.com",
+ messagingSenderId: "553744005117",
+ appId: "1:553744005117:web:fd7a2e6647ea81c7218b94",
+ measurementId: "G-BJ4040V5N9"
};
// Initialize Firebase
export const app = initializeApp(firebaseConfig);
+const analytics = getAnalytics(app);
\ No newline at end of file
diff --git a/client/src/pages/About.jsx b/client/src/pages/About.jsx
deleted file mode 100644
index 043e95f..0000000
--- a/client/src/pages/About.jsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from 'react';
-
-export default function About() {
- return (
-
-
About
-
- This is a MERN (MongoDB, Express, React, Node.js) stack application with
- authentication. It allows users to sign up, log in, and log out, and
- provides access to protected routes only for authenticated users.
-
-
- The front-end of the application is built with React and uses React
- Router for client-side routing. The back-end is built with Node.js and
- Express, and uses MongoDB as the database. Authentication is implemented
- using JSON Web Tokens (JWT).
-
-
- This application is intended as a starting point for building full-stack
- web applications with authentication using the MERN stack. Feel free to
- use it as a template for your own projects!
-
}
+ >
+ );
+}
diff --git a/client/src/pages/Home.jsx b/client/src/pages/Home.jsx
index 2a3467e..51884a5 100644
--- a/client/src/pages/Home.jsx
+++ b/client/src/pages/Home.jsx
@@ -1,28 +1,33 @@
-import React from 'react';
+import React, { useState } from 'react';
-export default function Home() {
+const ValidatedInput = () => {
+ const [value, setValue] = useState('');
+ const [isValid, setIsValid] = useState(true);
+
+ const handleChange = (event) => {
+ const inputValue = event.target.value;
+ setValue(inputValue);
+
+ // Example validation logic - You can replace this with your own validation logic
+ if (inputValue.length > 0) {
+ setIsValid(true);
+ } else {
+ setIsValid(false);
+ }
+ };
+console.log(isValid)
return (
-
-
- Welcome to my Auth App!
-
-
- This is a full-stack web application built with the MERN (MongoDB,
- Express, React, Node.js) stack. It includes authentication features that
- allow users to sign up, log in, and log out, and provides access to
- protected routes only for authenticated users.
-
-
- The front-end of the application is built with React and uses React
- Router for client-side routing. The back-end is built with Node.js and
- Express, and uses MongoDB as the database. Authentication is implemented
- using JSON Web Tokens (JWT).
-
-
- This application is intended as a starting point for building full-stack
- web applications with authentication using the MERN stack. Feel free to
- use it as a template for your own projects!
-