Skip to content

Instantly share code, notes, and snippets.

@ahoward ahoward/a.js
Created Aug 12, 2018

Embed
What would you like to do?
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
//
import Vue from 'vue'
import App from './App'
import router from './router'
import firebase from 'firebase'
Vue.config.productionTip = false
// TODO - factor out this config into dev/prod/staging based configs
var config = { // dojo4@dojo4.com
apiKey: "AIzaSyDVn1M1LqAKXKk5t7s2FJGMVATruprvh7k",
authDomain: "su2c-tribute-5f922.firebaseapp.com",
databaseURL: "https://su2c-tribute-5f922.firebaseio.com",
projectId: "su2c-tribute-5f922",
storageBucket: "su2c-tribute-5f922.appspot.com",
messagingSenderId: "12717696225"
};
firebase.initializeApp(config);
// TODO - actually handle errors
firebase.auth().signInAnonymously().catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
});
// boot app once firebase has finished initializing
let app;
firebase.auth().onAuthStateChanged(function(user){
const data = {};
data.current = {};
data.current.user = user;
console.dir({'data': data});
console.dir({'user': user});
if(!app){
/* eslint-disable no-new */
app = new Vue({
el: '#app',
router,
components: { App },
template: '<App/>',
data: data
})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.