I'm trying to access the session in vue-router viathis.a.app, but it pops out 1 error.
After i debug, i found out that this is undefined.
this is the code im using to show this.
I had tried to use function(to, from, next) {...} instead of es6 syntax, but this is still undefined.
router.beforeEach((to, from, next) => {
if (!to.meta.isPublic){
// eslint-disable-next-line
console.log(this)
}
next()
})
Is there any configuration i need to make so that i can access this in vue-router?