I am kinda new to VueJS and I am trying to pass the role of a user from the login path after he/she has been authenticated to the home page where I can then determine what links the user can see using v-if. Below is my login.vue code:
this.$axios({
method: 'post',
url: 'api/role',
data: {
'email': this.username
},
headers: {'Authorization': 'Bearer '+ this.$tokens.getToken()}
})
.then(response => {
this.role = response.data['role'];
})
this.$router.push('/');
})
.catch(function(error){
console.log(error);
})
How can I pass the 'this.role' value to path '/' so I can access it from there?