-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebase.js
48 lines (45 loc) · 1.42 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
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import {
getAuth,
signInWithEmailAndPassword,
createUserWithEmailAndPassword,
signOut,
} from "firebase/auth";
import { getStorage } from "firebase/storage";
import { initializeFirestore } from "firebase/firestore";
// 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
const firebaseConfig = {
apiKey: "AIzaSyB-gWHjG0SKdRbzwzeeV3sSllOMTUxCjto",
authDomain: "bloodnet-4921e.firebaseapp.com",
projectId: "bloodnet-4921e",
storageBucket: "bloodnet-4921e.appspot.com",
messagingSenderId: "1054896775920",
appId: "1:1054896775920:web:5048d7f59dccdfdc1d5835",
};
// Initialize Firebase
export const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const storage = getStorage(app);
export const db = initializeFirestore(app, {
experimentalForceLongPolling: true,
});
export function signIn(email, password) {
return signInWithEmailAndPassword(auth, email, password);
}
export function signUp(email, password) {
return createUserWithEmailAndPassword(auth, email, password);
}
export function SignOut() {
signOut(auth)
.then(() => {
// Sign-out successful.
})
.catch((error) => {
// An error happened.
console.log(error);
});
// return signOut(auth);
}