// 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 fireuser; var vue = new Vue({ el: '#vue-app', prop: { name: '' }, data() { return { dataPic: '' } }, methods: { updateUser(){ }, getPicUrl(){ return this.picUrl; } }, beforeCreate() { firebase.auth().onAuthStateChanged(function(user) { if (user) { fireuser = user; //GetUser axios.get('/getUser/' + fireuser.uid).then(result => { name = result.data[0].name; dataPic = result.data[0].picture + ""; console.log("DataPic: ", dataPic) }).catch(err => console.error(err)); } else { window.location("/"); this.dataPic = "error" } }); }, });