Firebase beforeeach() fires a lot of times (Vue app)
0 I am building posts app using Firebase and Vue js. I have some issue: My router: import Vue from 'vue' import Router from 'vue-router' import Dashboard from '@/components/Dashboard' import Login from '@/components/Login' import SignUp from '@/components/SingUp' import RecentPosts from '@/components/RecentPosts'; import firebase from 'firebase' Vue.use(Router) let router = new Router( routes: [ ...... some routes path: '/recentPosts', name: 'RecentPosts', component: RecentPosts, meta: requireAuth: true ] ) router.beforeEach((to, from, next) => let currentUser = firebase.auth().currentUser; let requiresAuth = to.matched.some(r => r.meta.requiresAuth); console.log("CURRENTUSER",currentUser); if(!currentUser && requiresAuth) next('Login'); else if(currentUser && !requiresAuth) next('Dashboard'); else if (currentUser && requiresAu...