I'm relatively new to VueJS and I'm attempting to transfer a user's role from the login path once they've been authenticated over to the home page, where I can then determine which links the user can view using v-if. Here's an excerpt of 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);
})
Is there a way for me to pass the value of 'this.role' to the '/' path in order to access it from there?