Skip to content

Commit

Permalink
- Update config.js with the Firebase config keys
Browse files Browse the repository at this point in the history
- Replace signInWithRedirect with signInWithPopup in the useAuth hook
  • Loading branch information
Ahsan Hassan committed Aug 9, 2024
1 parent 7823994 commit db8f883
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/api/useAuth.jsx
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand All @@ -11,7 +11,7 @@ import { addUserToDatabase } from './firebase.js';
export const SignInButton = () => (
<button
type="button"
onClick={() => signInWithRedirect(auth, new GoogleAuthProvider())}
onClick={() => signInWithPopup(auth, new GoogleAuthProvider())}
>
Sign In
</button>
Expand Down

0 comments on commit db8f883

Please sign in to comment.