3👍
✅
This is probably because you have a typo at require(s)
:
{
path: '/recentPosts',
name: 'RecentPosts',
component: RecentPosts,
meta:{
requireAuth: true // <- without "s" at the end of require
}
}
]
})
router.beforeEach((to, from, next) => {
let currentUser = firebase.auth().currentUser;
let requiresAuth = to.matched.some(r => r.meta.requiresAuth); // <- with an "s" at the end of requires
Source:stackexchange.com