-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (27 loc) · 813 Bytes
/
index.js
File metadata and controls
27 lines (27 loc) · 813 Bytes
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
/**
* Basic firebase init for FabricElements
*/
(function() {
'use strict';
const firebase = window.firebase;
if (typeof firebase === 'undefined') {
throw new Error('hosting/init-error: Firebase SDK not detected.');
}
// Initialize Firebase
firebase.initializeApp({
apiKey: 'AIzaSyCJRNdR0eodnswyi8MHCtF1YOjY235mhM8',
authDomain: 'fabricelements.firebaseapp.com',
databaseURL: 'https://fabricelements.firebaseio.com',
projectId: 'fabricelements',
storageBucket: 'fabricelements.appspot.com',
messagingSenderId: '908593247251',
});
// set data property on dom-bind
let autobind = document.querySelector('dom-bind');
if (autobind) {
firebase.auth().onAuthStateChanged((user) => {
autobind.user = user;
autobind.signedIn = !(!user);
});
}
})();