MCPcopy Index your code
hub / github.com/ShareDropio/sharedrop / authenticateToFirebase

Function authenticateToFirebase

app/initializers/prerequisites.js:36–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 }
35
36 function authenticateToFirebase() {
37 return new Promise((resolve, reject) => {
38 const xhr = $.getJSON('/auth');
39 xhr.then((data) => {
40 const ref = new window.Firebase(config.FIREBASE_URL);
41 // eslint-disable-next-line no-param-reassign
42 application.ref = ref;
43 // eslint-disable-next-line no-param-reassign
44 application.userId = data.id;
45 // eslint-disable-next-line no-param-reassign
46 application.publicIp = data.public_ip;
47
48 ref.authWithCustomToken(data.token, (error) => {
49 if (error) {
50 reject(error);
51 } else {
52 resolve();
53 }
54 });
55 });
56 });
57 }
58
59 // TODO: move it to a separate initializer
60 function trackSizeOfReceivedFiles() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected