part way done with next item
This commit is contained in:
1 parent
492ecb3e3e
commit
5819aa7724
2 files changed
+11
-2
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
export default async ({ router }) => {
|
||||||
|
router.beforeEach((to, from, next) => {
|
||||||
|
console.log('to: ', to)
|
||||||
|
console.log('from: ', from)
|
||||||
|
console.log('next: ', next)
|
||||||
|
next()
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -38,10 +38,11 @@ const actions = {
|
|||||||
firebaseAuth.onAuthStateChanged(user => {
|
firebaseAuth.onAuthStateChanged(user => {
|
||||||
if (user) {
|
if (user) {
|
||||||
commit('setLoggedIn', true)
|
commit('setLoggedIn', true)
|
||||||
this.$router.push('/')
|
/* eslint handle-callback-err: "off" */
|
||||||
|
this.$router.push('/').catch(err => {})
|
||||||
} else {
|
} else {
|
||||||
commit('setLoggedIn', false)
|
commit('setLoggedIn', false)
|
||||||
this.$router.replace('/auth')
|
this.$router.replace('/auth').catch(err => { })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user