From 5819aa77240e58475b745e60f79c2b5a7f37a609 Mon Sep 17 00:00:00 2001 From: "Fredrick W. Warren" Date: Sat, 13 Feb 2021 21:55:58 -0800 Subject: [PATCH] part way done with next item --- src/boot/rooter-auth.js | 8 ++++++++ src/store/store-auth.js | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/boot/rooter-auth.js diff --git a/src/boot/rooter-auth.js b/src/boot/rooter-auth.js new file mode 100644 index 0000000..41007a8 --- /dev/null +++ b/src/boot/rooter-auth.js @@ -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() + }) +} diff --git a/src/store/store-auth.js b/src/store/store-auth.js index 2d0fb44..573958b 100644 --- a/src/store/store-auth.js +++ b/src/store/store-auth.js @@ -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 => { }) } }) }