part way done with next item

This commit is contained in:
Fredrick W. Warren 2021-02-13 21:55:58 -08:00
parent 492ecb3e3e
commit 5819aa7724
2 changed files with 11 additions and 2 deletions

8
src/boot/rooter-auth.js Normal file
View File

@ -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()
})
}

View File

@ -38,10 +38,11 @@ const actions = {
firebaseAuth.onAuthStateChanged(user => {
if (user) {
commit('setLoggedIn', true)
this.$router.push('/')
/* eslint handle-callback-err: "off" */
this.$router.push('/').catch(err => {})
} else {
commit('setLoggedIn', false)
this.$router.replace('/auth')
this.$router.replace('/auth').catch(err => { })
}
})
}