Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onAuthStateChanged: data => { // optional
console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
if (data.loggedIn) {
backendService.token = data.user.uid
console.log(data.user.uid)
store.commit('setUser', data.user)
Vue.navigateTo(Home)
}
else {
backendService.token = ""
Vue.navigateTo(Login)
}
}
}).then(
onAuthStateChanged: data => { // optional
console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
if (data.loggedIn) {
backendService.token = data.user.uid
console.log(data.user.uid)
store.commit('setUser', data.user)
Vue.navigateTo(Home)
}
else {
backendService.token = ""
Vue.navigateTo(Login)
}
}
}).then(
Vue.prototype.$changeRoute = (to) => {
Vue.navigateTo(routes[to])
}
render: h => h(backendService.isLoggedIn() ? Vue.navigateTo(Home) : Vue.navigateTo(Login)),