From db8f88359f62ea94138540ad57aec33cebbf6955 Mon Sep 17 00:00:00 2001 From: Ahsan Hassan Date: Fri, 9 Aug 2024 08:21:54 -0600 Subject: [PATCH] - Update config.js with the Firebase config keys - Replace signInWithRedirect with signInWithPopup in the useAuth hook --- src/api/config.js | 14 +++++++------- src/api/useAuth.jsx | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/api/config.js b/src/api/config.js index 2f15680..102f148 100644 --- a/src/api/config.js +++ b/src/api/config.js @@ -4,13 +4,13 @@ import { getAuth } from 'firebase/auth'; // Your web app's Firebase configuration const firebaseConfig = { - apiKey: 'FILL_ME_IN', - authDomain: 'FILL_ME_IN', - projectId: 'FILL_ME_IN', - storageBucket: 'FILL_ME_IN', - messagingSenderId: 'FILL_ME_IN', - appId: 'FILL_ME_IN', -}; + apiKey: "AIzaSyDmGxC-ITYFOyD6U1IrJAszf1KplXbG1Bs", + authDomain: "tcl-75-smart-shopping-list.firebaseapp.com", + projectId: "tcl-75-smart-shopping-list", + storageBucket: "tcl-75-smart-shopping-list.appspot.com", + messagingSenderId: "1081566633611", + appId: "1:1081566633611:web:b07badada6839daf2e3e8e" + }; // Initialize Firebase const app = initializeApp(firebaseConfig); diff --git a/src/api/useAuth.jsx b/src/api/useAuth.jsx index 5b1b123..ca07ae6 100644 --- a/src/api/useAuth.jsx +++ b/src/api/useAuth.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; import { auth } from './config.js'; -import { GoogleAuthProvider, signInWithRedirect } from 'firebase/auth'; +import { GoogleAuthProvider, signInWithPopup } from 'firebase/auth'; import { addUserToDatabase } from './firebase.js'; /** @@ -11,7 +11,7 @@ import { addUserToDatabase } from './firebase.js'; export const SignInButton = () => (