Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(function(resolve, reject) {
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}
const serverTime = firebase.database().getServerTime();
console.log(serverTime, 'ServerTime');
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
user = user.toJSON();
getUser(user.email)
.then(user => resolve(user))
.catch(error => reject());
} else {
reject();
}
});
});
}