in my Vue Js project i wanted to check if user logged in so he can access website and if not it should take him to /login page.. since i'm new to Vue Js i tried the below code but it didn't work in app.js, can someone please help me in this ?
mounted: function(){
if(JSON.parse(sessionStorage.user)){
console.log(JSON.parse(sessionStorage.user))
}
}