Answer the question
In order to leave comments, you need to log in
How to fix authorization in VueJS + Vuex + Router + Firebase?
Hello!
Started learning this wonderful VueJS framework and already faced one unsolvable problem. Maybe someone with more experience will chime in.
I made a project with authorization and a database on firebase.
In main.js I do
fb.auth().onAuthStateChanged(function (user) {
if (user) {
p.$store.dispatch('autoLoginUser', user)
}
})
if (store.getters.user) {
next()
} else {
next('/login?loginError=true')
}
beforeEnter: AuthGuard
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question