-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase.js
More file actions
69 lines (61 loc) · 1.5 KB
/
Copy pathfirebase.js
File metadata and controls
69 lines (61 loc) · 1.5 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import {
getApp,
getApps,
initializeApp
} from "./node_modules/firebase/firebase-app.js";
import {
browserLocalPersistence,
getAuth,
GithubAuthProvider,
GoogleAuthProvider,
setPersistence
} from "./node_modules/firebase/firebase-auth.js";
import {
getFirestore
} from "./node_modules/firebase/firebase-firestore.js";
const firebaseConfig = {
apiKey: "AIzaSyD1ndpHcajdgxdK6H5kDVu6dQ6NPuQ-oo0",
authDomain: "bytecode-cfc75.firebaseapp.com",
projectId: "bytecode-cfc75",
storageBucket: "bytecode-cfc75.firebasestorage.app",
messagingSenderId: "1028766224136",
appId: "1:1028766224136:web:2b3404790bc183403166bd"
};
const app = getApps().length ? getApp() : initializeApp(firebaseConfig);
const auth = getAuth(app);
const db = getFirestore(app);
const googleProvider = new GoogleAuthProvider();
const githubProvider = new GithubAuthProvider();
const defaultAdminEmails = new Set([
"abirxxdbrine2024@gmail.com"
]);
googleProvider.setCustomParameters({
prompt: "select_account"
});
githubProvider.setCustomParameters({
allow_signup: "true"
});
await setPersistence(auth, browserLocalPersistence);
function isDefaultAdminEmail(email) {
return defaultAdminEmails.has(String(email || "").trim().toLowerCase());
}
window.bytecodeFirebase = {
app,
auth,
db,
defaultAdminEmails,
googleProvider,
githubProvider,
isDefaultAdminEmail,
firebaseConfig
};
export {
app,
auth,
db,
defaultAdminEmails,
firebaseConfig,
githubProvider,
isDefaultAdminEmail,
googleProvider
};