// Initialize Firebase var config = { apiKey: "AIzaSyCuvwf78cmSDoZ2yS4XxHZhnjUn7yIHYfw", authDomain: "test-667ca.firebaseapp.com", databaseURL: "https://test-667ca.firebaseio.com", projectId: "test-667ca", storageBucket: "test-667ca.appspot.com", messagingSenderId: "221332577314" }; firebase.initializeApp(config); var vue = new Vue({ el: '#vue-app', prop: { name: '', getpic: '' }, data: { dataPic: '' }, methods: { updateUser(){ }, fotoChoose(){ }, getPicUrl(){ return this.picUrl; }, getUser(uid){ axios.get('/getUser/' + uid).then(result => { name = result.data[0].name; this.dataPic = result.data[0].picture + ""; console.log("Created: ", this.dataPic, name) }).catch(err => console.error(err)); } }, created() { firebase.auth().onAuthStateChanged(user => { if (user) { //GetUser this.getUser(user.uid); } else { window.location("/"); } }); } });