userSaveSession() {
return this.$store.dispatch('userSaveSession')
},
function authGuard(from, to, next) {
setTimeout(() => {
if(Store.getters.isUserAuth){
next()
} else {
next('/login')
}
}, 1000)
}
new Vue({
router,
store,
render: h => h(App),
created() {
firebase.auth().onAuthStateChanged(user => {
this.$store.dispatch('userSaveSession', user)
});
this.$store.dispatch('loadPosts')
},
}).$mount('#app');