generated from msalloum/CS178A-B-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Firebase.js
49 lines (40 loc) · 1.36 KB
/
Firebase.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { initializeApp } from "firebase/app";
import { getAuth, GoogleAuthProvider } from 'firebase/auth'
import { getFirestore } from "firebase/firestore"
//import 'firebase/firestore'
//import { useAuthState } from 'react-firebase-hooks/auth'
//import { useCollectionData } from 'react-firebase-hooks/firestore'
//import { signInWithEmailAndPassword } from 'firebase/auth' // added //
import { setPersistence, browserSessionPersistence } from 'firebase/auth'
import firebase from 'firebase/app'
const firebaseConfig = {
apiKey: "AIzaSyBYwE7zeVbWElrkzByoplpr1Tjy-UX3irg",
authDomain: "auth-dev-5c3a5.firebaseapp.com",
projectId: "auth-dev-5c3a5",
storageBucket: "auth-dev-5c3a5.appspot.com",
messagingSenderId: "464851300677",
appId: "1:464851300677:web:f5bf7abfdd6146dfd5ce2c"
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
setPersistence(auth, browserSessionPersistence);
export const provider = new GoogleAuthProvider();
export const db = getFirestore();
//export default app; // added //
/*export const signInWithGoogle = () => {
const provider = new GoogleAuthProvider();
signInWithPopup(auth, provider)
.then((re)=>{
console.log(re);
})
.catch((error) => {
console.log(error);
});
}
export function SignOut() {
signOut(auth)
.then(() => {
})
.catch((error) => {
});
}*/